[ovs-dev] [PATCH] netdev-linux: remove unreachable code in netdev_linux_rx_recv_tap

Ilya Maximets i.maximets at samsung.com
Wed Nov 25 08:23:50 UTC 2015


While splitting netdev_linux_rx_recv() into netdev_linux_rx_recv_sock()
and netdev_linux_rx_recv_tap() in commit
b73c85181df9 ("netdev-linux: Read packet auxdata to obtain vlan_tid")
error handling part was copied 'as is' to both functions.
But in case of netdev_linux_rx_recv_tap(), according to POSIX, the
number of bytes read shall never be greater than 'size'.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
---
 lib/netdev-linux.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index e047be5..ed78868 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -1040,8 +1040,6 @@ netdev_linux_rxq_recv_tap(int fd, struct dp_packet *buffer)
 
     if (retval < 0) {
         return errno;
-    } else if (retval > size) {
-        return EMSGSIZE;
     }
 
     dp_packet_set_size(buffer, dp_packet_size(buffer) + retval);
-- 
2.1.4




More information about the dev mailing list