mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
netdev-linux: Use "read", not "recv", for tap devices.
"recv" only works for sockets, but tap devices aren't sockets. Makes the userspace switch work again. Reported-by: Ravi Kerur <Ravi.Kerur@telekom.com> Reported-by: 胡靖飞 <hujingfei914@msn.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -797,7 +797,11 @@ netdev_linux_recv(struct netdev *netdev_, void *data, size_t size)
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
ssize_t retval = recv(netdev->fd, data, size, MSG_TRUNC);
|
||||
ssize_t retval;
|
||||
|
||||
retval = (netdev_->netdev_dev->netdev_class == &netdev_tap_class
|
||||
? read(netdev->fd, data, size)
|
||||
: recv(netdev->fd, data, size, MSG_TRUNC));
|
||||
if (retval >= 0) {
|
||||
return retval <= size ? retval : -EMSGSIZE;
|
||||
} else if (errno != EINTR) {
|
||||
|
Reference in New Issue
Block a user