X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fclassifier.c;h=dab8f620fbb6622422c8e6a37cdcf604462aec14;hb=2c8fcc9cd6a7bbb948f6c79879e89c7ed791c9b1;hp=26d45fc3639dd9bb32dce5722cd63c48a95b7b54;hpb=7ac8d8cf183ad547b861588647b2c631a901f19c;p=openvswitch diff --git a/lib/classifier.c b/lib/classifier.c index 26d45fc3..dab8f620 100644 --- a/lib/classifier.c +++ b/lib/classifier.c @@ -218,12 +218,10 @@ cls_rule_set_any_vid(struct cls_rule *rule) void cls_rule_set_dl_vlan(struct cls_rule *rule, ovs_be16 dl_vlan) { + flow_set_vlan_vid(&rule->flow, dl_vlan); if (dl_vlan == htons(OFP_VLAN_NONE)) { - cls_rule_set_dl_tci(rule, htons(0)); + rule->wc.vlan_tci_mask = htons(UINT16_MAX); } else { - dl_vlan &= htons(VLAN_VID_MASK); - rule->flow.vlan_tci &= ~htons(VLAN_VID_MASK); - rule->flow.vlan_tci |= htons(VLAN_CFI) | dl_vlan; rule->wc.vlan_tci_mask |= htons(VLAN_VID_MASK | VLAN_CFI); } } @@ -247,9 +245,7 @@ cls_rule_set_any_pcp(struct cls_rule *rule) void cls_rule_set_dl_vlan_pcp(struct cls_rule *rule, uint8_t dl_vlan_pcp) { - dl_vlan_pcp &= 0x07; - rule->flow.vlan_tci &= ~htons(VLAN_PCP_MASK); - rule->flow.vlan_tci |= htons((dl_vlan_pcp << VLAN_PCP_SHIFT) | VLAN_CFI); + flow_set_vlan_pcp(&rule->flow, dl_vlan_pcp); rule->wc.vlan_tci_mask |= htons(VLAN_CFI | VLAN_PCP_MASK); }