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 <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
/* prepare the pcap argument to store the packet */
arg.size = ofpbuf_tailroom(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) {
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) {
return 0;
}
if (ret == -1) {
size_t size = ofpbuf_tailroom(buffer);
for (;;) {
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);
- buffer->size += retval;
+ ofpbuf_set_size(buffer, ofpbuf_size(buffer) + retval);
return 0;
} else if (errno != EINTR) {
if (errno != EAGAIN) {
return 0;
} else if (errno != EINTR) {
if (errno != EAGAIN) {
{
struct netdev_bsd *dev = netdev_bsd_cast(netdev_);
const char *name = netdev_get_name(netdev_);
{
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);
int error;
ovs_mutex_lock(&dev->mutex);