tap_pl: fixed behaviour in send
authorGiuseppe Lettieri <g.lettieri@iet.unipi.it>
Tue, 1 May 2012 10:25:59 +0000 (10:25 +0000)
committerGiuseppe Lettieri <g.lettieri@iet.unipi.it>
Tue, 1 May 2012 10:25:59 +0000 (10:25 +0000)
Open vSwitch checks for type "tap" sometimes by string comparison of
the class name and sometimes by equality of class pointers.
I missed one of the latter.

lib/netdev-linux.c

index a8d7438..e0d749f 100644 (file)
@@ -866,7 +866,8 @@ netdev_linux_recv(struct netdev *netdev_, void *data, size_t size)
     for (;;) {
         ssize_t retval;
 
-        retval = (netdev_->netdev_dev->netdev_class == &netdev_tap_class
+        retval = ((netdev_->netdev_dev->netdev_class == &netdev_tap_class ||
+                   netdev_->netdev_dev->netdev_class == &netdev_tap_pl_class)
                   ? read(netdev->fd, data, size)
                   : recv(netdev->fd, data, size, MSG_TRUNC));
         if (retval >= 0) {