ofproto-dpif: Treat zero MPLS post-decrement TTL as invalid.
authorBen Pfaff <blp@nicira.com>
Thu, 7 Mar 2013 19:09:12 +0000 (11:09 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 7 Mar 2013 19:09:12 +0000 (11:09 -0800)
RFC 3443 says that an outgoing MPLS TTL of zero is invalid, so we must send
packets that have such a TTL post-decrement to the controller rather than
allowing them to continue through the OpenFlow tables.

Here is the text from RFC 3443 that implies this behavior:

   oTTL: This is the TTL value used as the outgoing TTL value (see
   section 3.5 for exception).  It is always (iTTL - 1) unless otherwise
   stated.

   oTTL Check: Check if oTTL is greater than 0.  If the oTTL Check is
   false, then the packet is not forwarded.  Note that the oTTL check is
   performed only if any outgoing TTL (either IP or MPLS) is set to oTTL
   (see section 3.5 for exception).

That is, the output TTL is one less than the input TTL, and a packet with
an output TTL of 0 must not be forwarded.

CC: Bruce Davie <bsd@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
ofproto/ofproto-dpif.c

index 89f5bf4..ff93dc3 100644 (file)
@@ -6087,7 +6087,7 @@ execute_dec_mpls_ttl_action(struct action_xlate_ctx *ctx)
         return false;
     }
 
-    if (ttl > 0) {
+    if (ttl > 1) {
         ttl--;
         set_mpls_lse_ttl(&ctx->flow.mpls_lse, ttl);
         return false;