aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ndisc.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2006-03-20 19:55:08 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-20 19:55:08 -0500
commit65f5c7c1143fb8eed5bc7e7d8c926346e00fe3c0 (patch)
treefb61c9f73577a7fec29b11039d1434b972796d8b /net/ipv6/ndisc.c
parent073a8e0e154c1c440e0b33aaa887473d5cc843f4 (diff)
[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.c7
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)
1019 struct ra_msg *ra_msg = (struct ra_msg *) skb->h.raw; 1019 struct ra_msg *ra_msg = (struct ra_msg *) skb->h.raw;
1020 struct neighbour *neigh = NULL; 1020 struct neighbour *neigh = NULL;
1021 struct inet6_dev *in6_dev; 1021 struct inet6_dev *in6_dev;
1022 struct rt6_info *rt; 1022 struct rt6_info *rt = NULL;
1023 int lifetime; 1023 int lifetime;
1024 struct ndisc_options ndopts; 1024 struct ndisc_options ndopts;
1025 int optlen; 1025 int optlen;
@@ -1081,6 +1081,9 @@ static void ndisc_router_discovery(struct sk_buff *skb)
1081 (ra_msg->icmph.icmp6_addrconf_other ? 1081 (ra_msg->icmph.icmp6_addrconf_other ?
1082 IF_RA_OTHERCONF : 0); 1082 IF_RA_OTHERCONF : 0);
1083 1083
1084 if (!in6_dev->cnf.accept_ra_defrtr)
1085 goto skip_defrtr;
1086
1084 lifetime = ntohs(ra_msg->icmph.icmp6_rt_lifetime); 1087 lifetime = ntohs(ra_msg->icmph.icmp6_rt_lifetime);
1085 1088
1086 rt = rt6_get_dflt_router(&skb->nh.ipv6h->saddr, skb->dev); 1089 rt = rt6_get_dflt_router(&skb->nh.ipv6h->saddr, skb->dev);
@@ -1128,6 +1131,8 @@ static void ndisc_router_discovery(struct sk_buff *skb)
1128 rt->u.dst.metrics[RTAX_HOPLIMIT-1] = ra_msg->icmph.icmp6_hop_limit; 1131 rt->u.dst.metrics[RTAX_HOPLIMIT-1] = ra_msg->icmph.icmp6_hop_limit;
1129 } 1132 }
1130 1133
1134skip_defrtr:
1135
1131 /* 1136 /*
1132 * Update Reachable Time and Retrans Timer 1137 * Update Reachable Time and Retrans Timer
1133 */ 1138 */