[ovs-dev] [PATCH] netdev-linux: Fix netdev_linux_send() return value in corner case.

Justin Pettit jpettit at nicira.com
Tue Feb 26 23:46:58 UTC 2013


Looks good.

--Justin


On Feb 26, 2013, at 12:35 PM, Ben Pfaff <blp at nicira.com> wrote:

> A negative 'sock' means there was an error but netdev_linux_send() returns
> a positive errno value on error.
> 
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
> lib/netdev-linux.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
> index 4ea7a36..c0e0c40 100644
> --- a/lib/netdev-linux.c
> +++ b/lib/netdev-linux.c
> @@ -916,7 +916,7 @@ netdev_linux_send(struct netdev *netdev_, const void *data, size_t size)
> 
>             sock = af_packet_sock();
>             if (sock < 0) {
> -                return sock;
> +                return -sock;
>             }
> 
>             error = get_ifindex(netdev_, &ifindex);
> -- 
> 1.7.2.5
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev




More information about the dev mailing list