From be80bc65c1da6225d3de238c041906bb459ee8ea Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 7 Mar 2013 11:09:12 -0800 Subject: [PATCH] ofproto-dpif: Treat zero MPLS post-decrement TTL as invalid. 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 Signed-off-by: Ben Pfaff Reviewed-by: Simon Horman --- ofproto/ofproto-dpif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 89f5bf48a..ff93dc3b4 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -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; -- 2.47.0