netdev-linux: Fix blocking while sending packets.
authorBen Pfaff <blp@nicira.com>
Fri, 8 Apr 2011 21:23:13 +0000 (14:23 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 11 Apr 2011 16:36:48 +0000 (09:36 -0700)
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

index 1aa9093..50bec08 100644 (file)
@@ -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. */