From: Ben Pfaff Date: Tue, 26 Feb 2013 20:35:40 +0000 (-0800) Subject: netdev-linux: Fix netdev_linux_send() return value in corner case. X-Git-Tag: v1.9.3~39 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;ds=sidebyside;h=3f079d423336ed82929fcaf85a4475c88d5f3f6e;p=cascardo%2Fovs.git netdev-linux: Fix netdev_linux_send() return value in corner case. A negative 'sock' means there was an error but netdev_linux_send() returns a positive errno value on error. Signed-off-by: Ben Pfaff --- diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 1fac087df..14e217a1b 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -941,7 +941,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);