ofproto-dpif-xlate: Correct check for MPLS LSE
authorSimon Horman <horms@verge.net.au>
Tue, 7 Jan 2014 04:48:08 +0000 (13:48 +0900)
committerJarno Rajahalme <jrajahalme@nicira.com>
Wed, 9 Apr 2014 20:03:18 +0000 (13:03 -0700)
zero is a valid MPLS LSE so it is not valid check against
that value for MPLS LSE presence. Instead, check against
the flow's dl_type which should be an MPLS type if an LSE is present.

This problem appears to have been introduced by
b2dd70be133bf86c ("Native Set-Field action.").

Cc: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto-dpif-xlate.c

index 14e8fe2..ad60b07 100644 (file)
@@ -2758,7 +2758,7 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len,
              * applicable header fields.  Do nothing if no header exists. */
             if ((mf->id != MFF_VLAN_VID || flow->vlan_tci & htons(VLAN_CFI))
                 && ((mf->id != MFF_MPLS_LABEL && mf->id != MFF_MPLS_TC)
-                    || flow->mpls_lse)) {
+                    || eth_type_mpls(flow->dl_type))) {
                 mf_set_flow_value(mf, &set_field->value, flow);
             }
             break;