From: YAMAMOTO Takashi Date: Wed, 9 Apr 2014 03:43:49 +0000 (+0900) Subject: netdev-bsd: Update for recent ofpbuf api changes X-Git-Tag: sliver-openvswitch-2.2.90-1~5^2~4 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=671a7fdff8ecd28554d09c32f06c3adb1d723ac5 netdev-bsd: Update for recent ofpbuf api changes Leftovers from commit commit 1f317cb5. ("ofpbuf: Introduce access api for base, data and size.") This fixes regressons introduced by commit 3f976e12. ("lib/ofpbuf: Rename private fields to discourage direct use.") Acked-by: Ben Pfaff Signed-off-by: YAMAMOTO Takashi --- diff --git a/lib/netdev-bsd.c b/lib/netdev-bsd.c index 9952aef64..cb4f5e8d9 100644 --- a/lib/netdev-bsd.c +++ b/lib/netdev-bsd.c @@ -577,13 +577,13 @@ netdev_rxq_bsd_recv_pcap(struct netdev_rxq_bsd *rxq, struct ofpbuf *buffer) /* prepare the pcap argument to store the packet */ arg.size = ofpbuf_tailroom(buffer); - arg.data = buffer->data; + arg.data = ofpbuf_data(buffer); for (;;) { ret = pcap_dispatch(rxq->pcap_handle, 1, proc_pkt, (u_char *) &arg); if (ret > 0) { - buffer->size += arg.retval; + ofpbuf_set_size(buffer, ofpbuf_size(buffer) + arg.retval); return 0; } if (ret == -1) { @@ -607,9 +607,9 @@ netdev_rxq_bsd_recv_tap(struct netdev_rxq_bsd *rxq, struct ofpbuf *buffer) size_t size = ofpbuf_tailroom(buffer); for (;;) { - ssize_t retval = read(rxq->fd, buffer->data, size); + ssize_t retval = read(rxq->fd, ofpbuf_data(buffer), size); if (retval >= 0) { - buffer->size += retval; + ofpbuf_set_size(buffer, ofpbuf_size(buffer) + retval); return 0; } else if (errno != EINTR) { if (errno != EAGAIN) { @@ -687,8 +687,8 @@ netdev_bsd_send(struct netdev *netdev_, struct ofpbuf *pkt, bool may_steal) { struct netdev_bsd *dev = netdev_bsd_cast(netdev_); const char *name = netdev_get_name(netdev_); - const void *data = pkt->data; - size_t size = pkt->size; + const void *data = ofpbuf_data(pkt); + size_t size = ofpbuf_size(pkt); int error; ovs_mutex_lock(&dev->mutex);