From: Duan Jiong Date: Tue, 26 Nov 2013 07:46:56 +0000 (+0800) Subject: ipv6: judge the accept_ra_defrtr before calling rt6_route_rcv X-Git-Tag: firefly_0821_release~176^2~4771^2~76 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=30e56918dd1e6d64350661f186657f6a6f2646e6;p=firefly-linux-kernel-4.4.55.git ipv6: judge the accept_ra_defrtr before calling rt6_route_rcv when dealing with a RA message, if accept_ra_defrtr is false, the kernel will not add the default route, and then deal with the following route information options. Unfortunately, those options maybe contain default route, so let's judge the accept_ra_defrtr before calling rt6_route_rcv. Signed-off-by: Duan Jiong Signed-off-by: David S. Miller --- diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 3512177deb4d..300865171394 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1277,6 +1277,9 @@ skip_linkparms: ri->prefix_len == 0) continue; #endif + if (ri->prefix_len == 0 && + !in6_dev->cnf.accept_ra_defrtr) + continue; if (ri->prefix_len > in6_dev->cnf.accept_ra_rt_info_max_plen) continue; rt6_route_rcv(skb->dev, (u8*)p, (p->nd_opt_len) << 3,