Skip to content

Commit

Permalink
mpls: Correct the ttl decrement.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ebiederm authored and davem330 committed Mar 8, 2015
1 parent 0f7bbd5 commit aa7da93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mpls/af_mpls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit aa7da93

Please sign in to comment.