X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fflow.c;h=29714b1cea9c900e3ec766eda05c5212bbda2888;hb=73dbf4abd17b6b87fdb5bf22aec7bb3d381dce05;hp=5d18212f7cbae03eca3a2c9a42a9006f816bc430;hpb=2bcf7df6f7a87d8940deff6fbbc359b0a310a74a;p=openvswitch diff --git a/lib/flow.c b/lib/flow.c index 5d18212f..29714b1c 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -507,6 +507,19 @@ flow_zero_wildcards(struct flow *flow, const struct flow_wildcards *wildcards) flow->skb_priority = 0; } +/* Initializes 'fmd' with the metadata found in 'flow'. */ +void +flow_get_metadata(const struct flow *flow, struct flow_metadata *fmd) +{ + fmd->tun_id = flow->tun_id; + fmd->tun_id_mask = htonll(UINT64_MAX); + + memcpy(fmd->regs, flow->regs, sizeof fmd->regs); + memset(fmd->reg_masks, 0xff, sizeof fmd->reg_masks); + + fmd->in_port = flow->in_port; +} + char * flow_to_string(const struct flow *flow) { @@ -995,7 +1008,7 @@ flow_compose(struct ofpbuf *b, const struct flow *flow) } if (flow->vlan_tci & htons(VLAN_CFI)) { - eth_push_vlan(b, flow->vlan_tci & ~htons(VLAN_CFI)); + eth_push_vlan(b, flow->vlan_tci); } if (flow->dl_type == htons(ETH_TYPE_IP)) {