Currently set_field_from_openflow is checking that the OFPVID_PRESENT bit
is set for a set VLAN_VID action to be valid.
I am reading the OF specs 1.2, 1.3 and 1.4, and I cannot see any mentioning
of OFPVID_PRESENT being required in this context. OFPVID_PRESENT is used as
a special VLAN_VID value for matching.

-Marco

Signed-off-by: Marco Canini <marco.can...@acm.org>
---
diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index e07ea1d..ce5546a 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -810,9 +810,7 @@ set_field_from_openflow(const struct
ofp12_action_set_field *oasf,

     /* The value must be valid for match and must have the OFPVID_PRESENT
bit
      * on for OXM_OF_VLAN_VID. */
-    if (!mf_is_value_valid(mf, &sf->value)
-        || (mf->id == MFF_VLAN_VID
-            && !(sf->value.be16 & htons(OFPVID12_PRESENT)))) {
+    if (!mf_is_value_valid(mf, &sf->value)) {
         struct ds ds = DS_EMPTY_INITIALIZER;
         mf_format(mf, &sf->value, NULL, &ds);
         VLOG_WARN_RL(&rl, "Invalid value for set field %s: %s",
@@ -2852,8 +2850,7 @@ ofpact_to_openflow12(const struct ofpact *a, struct
ofpbuf *out)
             }
             field = MFF_VLAN_VID;
             /* Set-Field on OXM_OF_VLAN_VID must have OFPVID_PRESENT set.
*/
-            value.be16 = htons(ofpact_get_SET_VLAN_VID(a)->vlan_vid
-                               | OFPVID12_PRESENT);
+            value.be16 = htons(ofpact_get_SET_VLAN_VID(a)->vlan_vid);
             break;

         case OFPACT_SET_VLAN_PCP:
--
2.0.90
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to