* Remove duplicate definition of OFP_VLAN_NONE
* Rename OFP_VLAN_NONE as OFP10_VLAN_NONE as it appears to be
  only used by OpenFlow 1.0.

As suggested by Ben Pfaff.

Signed-off-by: Simon Horman <ho...@verge.net.au>

---
 include/openflow/openflow-1.0.h | 7 +------
 lib/classifier.c                | 2 +-
 lib/flow.c                      | 2 +-
 lib/ofp-util.c                  | 5 +++--
 4 files changed, 6 insertions(+), 10 deletions(-)

v2
* Removed bogus '#include <meta-flow.h>' hunk

diff --git a/include/openflow/openflow-1.0.h b/include/openflow/openflow-1.0.h
index 039eb6b..d71b007 100644
--- a/include/openflow/openflow-1.0.h
+++ b/include/openflow/openflow-1.0.h
@@ -240,11 +240,6 @@ struct ofp10_action_output {
 };
 OFP_ASSERT(sizeof(struct ofp10_action_output) == 8);
 
-/* The VLAN id is 12 bits, so we can use the entire 16 bits to indicate
- * special conditions.  All ones is used to match that no VLAN id was
- * set. */
-#define OFP_VLAN_NONE      0xffff
-
 /* Action header for OFPAT10_VENDOR. The rest of the body is vendor-defined. */
 struct ofp_action_vendor_header {
     ovs_be16 type;                  /* OFPAT10_VENDOR. */
@@ -369,7 +364,7 @@ enum ofp_flow_wildcards {
 /* The VLAN id is 12-bits, so we can use the entire 16 bits to indicate
  * special conditions.  All ones indicates that no VLAN id was set.
  */
-#define OFP_VLAN_NONE      0xffff
+#define OFP10_VLAN_NONE      0xffff
 
 /* Fields to match against flows */
 struct ofp10_match {
diff --git a/lib/classifier.c b/lib/classifier.c
index 0541b5c..6e8f4d2 100644
--- a/lib/classifier.c
+++ b/lib/classifier.c
@@ -247,7 +247,7 @@ 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)) {
+    if (dl_vlan == htons(OFP10_VLAN_NONE)) {
         rule->wc.vlan_tci_mask = htons(UINT16_MAX);
     } else {
         rule->wc.vlan_tci_mask |= htons(VLAN_VID_MASK | VLAN_CFI);
diff --git a/lib/flow.c b/lib/flow.c
index d90a738..9ad1898 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -947,7 +947,7 @@ flow_hash_fields_valid(enum nx_hash_fields fields)
 void
 flow_set_vlan_vid(struct flow *flow, ovs_be16 vid)
 {
-    if (vid == htons(OFP_VLAN_NONE)) {
+    if (vid == htons(OFP10_VLAN_NONE)) {
         flow->vlan_tci = htons(0);
     } else {
         vid &= htons(VLAN_VID_MASK);
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 834bb62..d9a77f1 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -171,7 +171,8 @@ ofputil_cls_rule_from_ofp10_match(const struct ofp10_match 
*match,
     rule->flow.nw_proto = match->nw_proto;
 
     /* Translate VLANs. */
-    if (!(ofpfw & OFPFW10_DL_VLAN) && match->dl_vlan == htons(OFP_VLAN_NONE)) {
+    if (!(ofpfw & OFPFW10_DL_VLAN) &&
+        match->dl_vlan == htons(OFP10_VLAN_NONE)) {
         /* Match only packets without 802.1Q header.
          *
          * When OFPFW10_DL_VLAN_PCP is wildcarded, this is obviously correct.
@@ -232,7 +233,7 @@ ofputil_cls_rule_to_ofp10_match(const struct cls_rule *rule,
         ofpfw |= OFPFW10_DL_VLAN | OFPFW10_DL_VLAN_PCP;
     } else if (rule->wc.vlan_tci_mask & htons(VLAN_CFI)
                && !(rule->flow.vlan_tci & htons(VLAN_CFI))) {
-        match->dl_vlan = htons(OFP_VLAN_NONE);
+        match->dl_vlan = htons(OFP10_VLAN_NONE);
     } else {
         if (!(rule->wc.vlan_tci_mask & htons(VLAN_VID_MASK))) {
             ofpfw |= OFPFW10_DL_VLAN;
-- 
1.7.10.2.484.gcd07cc5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to