X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnetdev-tunnel.c;h=6b54697536aa6fa6b0dc4aaa391b716f1b60eff9;hb=90b4feffb9a9031775b949090db6c1c3f963779a;hp=b197e53a93c9c6e3a5641dff5212424ef60af871;hpb=5689b76e77dafa01d849aad0edf65d46f5d62c50;p=sliver-openvswitch.git diff --git a/lib/netdev-tunnel.c b/lib/netdev-tunnel.c index b197e53a9..6b5469753 100644 --- a/lib/netdev-tunnel.c +++ b/lib/netdev-tunnel.c @@ -271,7 +271,7 @@ netdev_tunnel_rx_recv(struct netdev_rx *rx_, struct ofpbuf *buffer) struct netdev_tunnel *netdev = netdev_tunnel_cast(rx_->netdev); if (!netdev->connected) - return -EAGAIN; + return EAGAIN; for (;;) { ssize_t retval; retval = recv(rx->fd, buffer->data, size, MSG_TRUNC); @@ -281,11 +281,12 @@ netdev_tunnel_rx_recv(struct netdev_rx *rx_, struct ofpbuf *buffer) netdev->stats.rx_packets++; netdev->stats.rx_bytes += retval; if (retval <= size) { - return retval; + buffer->size += retval; + return 0; } else { netdev->stats.rx_errors++; netdev->stats.rx_length_errors++; - return -EMSGSIZE; + return EMSGSIZE; } } else if (errno != EINTR) { if (errno != EAGAIN) { @@ -293,7 +294,7 @@ netdev_tunnel_rx_recv(struct netdev_rx *rx_, struct ofpbuf *buffer) netdev_rx_get_name(rx_), ovs_strerror(errno)); netdev->stats.rx_errors++; } - return -errno; + return errno; } } }