flow: Copy MPLS label on mpls_push.
authorJoe Stringer <joestringer@nicira.com>
Sat, 8 Feb 2014 00:39:53 +0000 (16:39 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 11 Feb 2014 18:05:01 +0000 (10:05 -0800)
OpenFlow 1.3.3 spec (and earlier) specify that the default value for an
MPLS label should be copied from the outer header.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/flow.c

index 06ba036..e7fe4d3 100644 (file)
@@ -1130,7 +1130,7 @@ flow_count_common_mpls_labels(const struct flow *a, int an,
  * If the new label is the second or label MPLS label in 'flow', it is
  * generated as;
  *
- *     - label: 0.
+ *     - label: Copied from outer label.
  *
  *     - TTL: Copied from outer label.
  *
@@ -1156,7 +1156,7 @@ flow_push_mpls(struct flow *flow, int n, ovs_be16 mpls_eth_type,
             flow->mpls_lse[i] = flow->mpls_lse[i - 1];
         }
         flow->mpls_lse[0] = (flow->mpls_lse[1]
-                             & htonl(MPLS_TTL_MASK | MPLS_TC_MASK));
+                             & htonl(~MPLS_BOS_MASK));
     } else {
         int label = 0;          /* IPv4 Explicit Null. */
         int tc = 0;