X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnetdev-pltap.c;h=04e68bad30d2b453d45a5c5d9d3a545961d48840;hb=1e827902be9194d71ea851c9ce2676f65eeed33a;hp=00181ab3b1d4382159d3842c47d8b87c7ac35f73;hpb=57e8d2bdc174cb24e2ae474ea805c7b7308d68a5;p=sliver-openvswitch.git diff --git a/lib/netdev-pltap.c b/lib/netdev-pltap.c index 00181ab3b..04e68bad3 100644 --- a/lib/netdev-pltap.c +++ b/lib/netdev-pltap.c @@ -507,13 +507,14 @@ netdev_pltap_set_config(struct netdev *dev_, const struct smap *args) } static int -netdev_pltap_rx_recv(struct netdev_rx *rx_, void *buffer, size_t size) +netdev_pltap_rx_recv(struct netdev_rx *rx_, struct ofpbuf *buffer) { + size_t size = ofpbuf_tailroom(buffer); struct netdev_rx_pltap *rx = netdev_rx_pltap_cast(rx_); struct tun_pi pi; struct iovec iov[2] = { { .iov_base = &pi, .iov_len = sizeof(pi) }, - { .iov_base = buffer, .iov_len = size } + { .iov_base = buffer->data, .iov_len = size } }; for (;;) { ssize_t retval; @@ -562,7 +563,7 @@ netdev_pltap_send(struct netdev *netdev_, const void *buffer, size_t size) retval = writev(dev->fd, iov, 2); if (retval >= 0) { if (retval != size + 4) { - VLOG_WARN_RL(&rl, "sent partial Ethernet packet (%zd bytes of %zu) on %s", + VLOG_WARN_RL(&rl, "sent partial Ethernet packet (%"PRIdSIZE" bytes of %"PRIuSIZE") on %s", retval, size + 4, netdev_get_name(netdev_)); } return 0; @@ -862,8 +863,6 @@ const struct netdev_class netdev_pltap_class = { netdev_pltap_update_flags, - netdev_pltap_change_seq, - netdev_pltap_rx_alloc, netdev_pltap_rx_construct, netdev_pltap_rx_destruct,