mpls: Correct the ttl decrement.
authorEric W. Biederman <ebiederm@xmission.com>
Sat, 7 Mar 2015 22:23:23 +0000 (16:23 -0600)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 Mar 2015 23:30:06 +0000 (19:30 -0400)
According to RFC3032 section 2.4.2  packets with an outgoing
ttl of 0 MUST NOT be forwarded.  According to section 2.4.1
an outgoing TTL of 0 comes from an incomming TTL <= 1.

Therefore any packets that is received with a ttl <= 1 should
not have it's ttl decremented and forwarded.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mpls/af_mpls.c

index 5c99e3fc1b72fd676844e9b4559a17e46defa0d2..e120074157deb95faf989f0fc70de28ceddee67b 100644 (file)
@@ -162,7 +162,7 @@ static int mpls_forward(struct sk_buff *skb, struct net_device *dev,
        skb_forward_csum(skb);
 
        /* Verify ttl is valid */
-       if (dec.ttl <= 2)
+       if (dec.ttl <= 1)
                goto drop;
        dec.ttl -= 1;