X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnetdev-tunnel.c;h=b197e53a93c9c6e3a5641dff5212424ef60af871;hb=1e827902be9194d71ea851c9ce2676f65eeed33a;hp=3127e51bee7864fdb2df5c21fc1cd72b4a4e2461;hpb=2431be1b68d386bd616378d2c528242775c4d54a;p=sliver-openvswitch.git diff --git a/lib/netdev-tunnel.c b/lib/netdev-tunnel.c index 3127e51be..b197e53a9 100644 --- a/lib/netdev-tunnel.c +++ b/lib/netdev-tunnel.c @@ -264,8 +264,9 @@ netdev_tunnel_rx_dealloc(struct netdev_rx *rx_) } static int -netdev_tunnel_rx_recv(struct netdev_rx *rx_, void *buffer, size_t size) +netdev_tunnel_rx_recv(struct netdev_rx *rx_, struct ofpbuf *buffer) { + size_t size = ofpbuf_tailroom(buffer); struct netdev_rx_tunnel *rx = netdev_rx_tunnel_cast(rx_); struct netdev_tunnel *netdev = netdev_tunnel_cast(rx_->netdev); @@ -273,12 +274,12 @@ netdev_tunnel_rx_recv(struct netdev_rx *rx_, void *buffer, size_t size) return -EAGAIN; for (;;) { ssize_t retval; - retval = recv(rx->fd, buffer, size, MSG_TRUNC); - VLOG_DBG("%s: recv(%"PRIxPTR", %zu, MSG_TRUNC) = %zd", - netdev_rx_get_name(rx_), (uintptr_t)buffer, size, retval); + retval = recv(rx->fd, buffer->data, size, MSG_TRUNC); + VLOG_DBG("%s: recv(%"PRIxPTR", %"PRIuSIZE", MSG_TRUNC) = %"PRIdSIZE, + netdev_rx_get_name(rx_), (uintptr_t)buffer->data, size, retval); if (retval >= 0) { - netdev->stats.rx_packets++; - netdev->stats.rx_bytes += retval; + netdev->stats.rx_packets++; + netdev->stats.rx_bytes += retval; if (retval <= size) { return retval; } else { @@ -317,14 +318,14 @@ netdev_tunnel_send(struct netdev *netdev_, const void *buffer, size_t size) for (;;) { ssize_t retval; retval = send(dev->sockfd, buffer, size, 0); - VLOG_DBG("%s: send(%"PRIxPTR", %zu) = %zd", + VLOG_DBG("%s: send(%"PRIxPTR", %"PRIuSIZE") = %"PRIdSIZE, netdev_get_name(netdev_), (uintptr_t)buffer, size, retval); if (retval >= 0) { dev->stats.tx_packets++; dev->stats.tx_bytes += retval; if (retval != size) { - VLOG_WARN_RL(&rl, "sent partial Ethernet packet (%zd bytes of " - "%zu) on %s", retval, size, netdev_get_name(netdev_)); + VLOG_WARN_RL(&rl, "sent partial Ethernet packet (%"PRIdSIZE" bytes of " + "%"PRIuSIZE") on %s", retval, size, netdev_get_name(netdev_)); dev->stats.tx_errors++; } return 0; @@ -614,13 +615,11 @@ const struct netdev_class netdev_tunnel_class = { NULL, /* get_in6 */ NULL, /* add_router */ NULL, /* get_next_hop */ - NULL, /* get_drv_info */ + NULL, /* get_status */ NULL, /* arp_lookup */ netdev_tunnel_update_flags, - netdev_tunnel_change_seq, - netdev_tunnel_rx_alloc, netdev_tunnel_rx_construct, netdev_tunnel_rx_destruct,