X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdpif-netdev.c;h=3975b5a8bba7bc60cbacb82921d34176afef793d;hb=0cc96e48ab2fc573c3b7b69fe5a034bb29dde578;hp=08a721340f6a6f205665a9c2d559609a982f0e3b;hpb=d295e8e97acae13552a5b220d3fbcff8201064a2;p=openvswitch diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 08a72134..3975b5a8 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -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;