diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2006-03-21 03:55:08 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-21 03:55:08 +0300 |
commit | 65f5c7c1143fb8eed5bc7e7d8c926346e00fe3c0 (patch) | |
tree | fb61c9f73577a7fec29b11039d1434b972796d8b /net/ipv6/ndisc.c | |
parent | 073a8e0e154c1c440e0b33aaa887473d5cc843f4 (diff) | |
download | linux-65f5c7c1143fb8eed5bc7e7d8c926346e00fe3c0.tar.xz |
[IPV6]: ROUTE: Add accept_ra_defrtr sysctl.
This controls whether we accept default router information
in RAs.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ndisc.c')
-rw-r--r-- | net/ipv6/ndisc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index cb8856b1d951..e17116796059 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1019,7 +1019,7 @@ static void ndisc_router_discovery(struct sk_buff *skb) struct ra_msg *ra_msg = (struct ra_msg *) skb->h.raw; struct neighbour *neigh = NULL; struct inet6_dev *in6_dev; - struct rt6_info *rt; + struct rt6_info *rt = NULL; int lifetime; struct ndisc_options ndopts; int optlen; @@ -1081,6 +1081,9 @@ static void ndisc_router_discovery(struct sk_buff *skb) (ra_msg->icmph.icmp6_addrconf_other ? IF_RA_OTHERCONF : 0); + if (!in6_dev->cnf.accept_ra_defrtr) + goto skip_defrtr; + lifetime = ntohs(ra_msg->icmph.icmp6_rt_lifetime); rt = rt6_get_dflt_router(&skb->nh.ipv6h->saddr, skb->dev); @@ -1128,6 +1131,8 @@ static void ndisc_router_discovery(struct sk_buff *skb) rt->u.dst.metrics[RTAX_HOPLIMIT-1] = ra_msg->icmph.icmp6_hop_limit; } +skip_defrtr: + /* * Update Reachable Time and Retrans Timer */ |