X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdpif-netdev.c;h=3975b5a8bba7bc60cbacb82921d34176afef793d;hb=0cc96e48ab2fc573c3b7b69fe5a034bb29dde578;hp=ade658d8d7403c10118c27911bee7cfaefa9dd51;hpb=ca78c6b69c01508713b8a8e50065843fcaf53936;p=openvswitch diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index ade658d8..3975b5a8 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -1082,7 +1082,7 @@ dp_netdev_wait(void) /* Modify the TCI field of 'packet'. If a VLAN tag is not present, one - * is added with the TCI field set to 'tci'. If a VLAN tag is present, + * is added with the TCI field set to 'tci'. If a VLAN tag is present, * then 'mask' bits are cleared before 'tci' is logically OR'd into the * TCI field. * @@ -1104,7 +1104,6 @@ dp_netdev_modify_vlan_tci(struct ofpbuf *packet, uint16_t tci, uint16_t mask) veh->veth_tci |= htons(tci); } else { /* Insert new 802.1Q header. */ - struct eth_header *eh = packet->l2; struct vlan_eth_header tmp; memcpy(tmp.veth_dst, eh->eth_dst, ETH_ADDR_LEN); memcpy(tmp.veth_src, eh->eth_src, ETH_ADDR_LEN); @@ -1262,8 +1261,7 @@ dp_netdev_output_control(struct dp_netdev *dp, const struct ofpbuf *packet, } msg_size = sizeof *header + packet->size; - msg = ofpbuf_new(msg_size + DPIF_RECV_MSG_PADDING); - ofpbuf_reserve(msg, DPIF_RECV_MSG_PADDING); + msg = ofpbuf_new_with_headroom(msg_size, DPIF_RECV_MSG_PADDING); header = ofpbuf_put_uninit(msg, sizeof *header); header->type = queue_no; header->length = msg_size;