[ovs-dev] [ofp10_match test 1/2] ofp-util: Wildcard VLAN PCP in OF1.0 matches when 802.1Q not present.

Ben Pfaff blp at nicira.com
Tue Jul 10 06:45:25 UTC 2012


When an output OF1.0 match uses OFP_VLAN_NONE to match only when the 802.1Q
header is not present, it is somewhat contradictory to specify any value
for the VLAN PCP, since none can be present without an 802.1Q header, but
the match output by Open vSwitch did so.  This fixes it.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 lib/ofp-util.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 99f92a8..9fda563 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -234,6 +234,7 @@ ofputil_cls_rule_to_ofp10_match(const struct cls_rule *rule,
     } else if (rule->wc.vlan_tci_mask & htons(VLAN_CFI)
                && !(rule->flow.vlan_tci & htons(VLAN_CFI))) {
         match->dl_vlan = htons(OFP10_VLAN_NONE);
+        ofpfw |= OFPFW10_DL_VLAN_PCP;
     } else {
         if (!(rule->wc.vlan_tci_mask & htons(VLAN_VID_MASK))) {
             ofpfw |= OFPFW10_DL_VLAN;
-- 
1.7.2.5




More information about the dev mailing list