[ovs-dev] [uswitch 1/4] netdev-linux: Fix blocking while sending packets.

Ben Pfaff blp at nicira.com
Fri Apr 8 23:41:04 UTC 2011


The AF_PACKET socket needs to be in nonblocking mode or trying to send
a packet can take a long time.
---
 lib/netdev-linux.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index eecaaa5..aacc48b 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -452,6 +452,7 @@ netdev_linux_init(void)
                 VLOG_ERR("failed to create packet socket: %s",
                          strerror(status));
             }
+            set_nonblocking(af_packet_sock);
         }
 
         /* Create rtnetlink socket. */
-- 
1.7.1




More information about the dev mailing list