diff options
| author | droidfivex <droidfivex@gmail.com> | 2016-11-18 01:05:47 +0900 |
|---|---|---|
| committer | droidfivex <droidfivex@gmail.com> | 2016-11-18 01:05:47 +0900 |
| commit | 1e8e1576c95730e425f472a569bb15325329a99e (patch) | |
| tree | 66b14ebbc47c0bc6023aa57b91b1ab5a9ee6c8e6 /net/ipv6/ndisc.c | |
| parent | 8b77716a2a034c7658ea6569ddaa814c312dd94f (diff) | |
| parent | 30bdd78c2f639b28acc02a4133479311e01b18ce (diff) | |
Diffstat (limited to 'net/ipv6/ndisc.c')
| -rw-r--r-- | net/ipv6/ndisc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 176b469322a..882525464a0 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1266,7 +1266,14 @@ static void ndisc_router_discovery(struct sk_buff *skb) if (rt) rt6_set_expires(rt, jiffies + (HZ * lifetime)); if (ra_msg->icmph.icmp6_hop_limit) { - in6_dev->cnf.hop_limit = ra_msg->icmph.icmp6_hop_limit; + /* Only set hop_limit on the interface if it is higher than + * the current hop_limit. + */ + if (in6_dev->cnf.hop_limit < ra_msg->icmph.icmp6_hop_limit) { + in6_dev->cnf.hop_limit = ra_msg->icmph.icmp6_hop_limit; + } else { + ND_PRINTK2(KERN_WARNING, "RA: Got route advertisement with lower hop_limit than current\n"); + } if (rt) dst_metric_set(&rt->dst, RTAX_HOPLIMIT, ra_msg->icmph.icmp6_hop_limit); |
