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 1aa909345f6c241e3865d5ec3e0e84f47580e773..50bec0887f38cc88b0ee0143585cdb82a2c8e289 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. */