diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 19 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 4 |
2 files changed, 22 insertions, 1 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index e7add61e6e39..eb82cd5df8c6 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -170,6 +170,9 @@ struct ipv6_devconf ipv6_devconf = { | |||
170 | #ifdef CONFIG_IPV6_ROUTER_PREF | 170 | #ifdef CONFIG_IPV6_ROUTER_PREF |
171 | .accept_ra_rtr_pref = 1, | 171 | .accept_ra_rtr_pref = 1, |
172 | .rtr_probe_interval = 60 * HZ, | 172 | .rtr_probe_interval = 60 * HZ, |
173 | #ifdef CONFIG_IPV6_ROUTE_INFO | ||
174 | .accept_ra_rt_info_max_plen = 0, | ||
175 | #endif | ||
173 | #endif | 176 | #endif |
174 | }; | 177 | }; |
175 | 178 | ||
@@ -197,6 +200,9 @@ static struct ipv6_devconf ipv6_devconf_dflt = { | |||
197 | #ifdef CONFIG_IPV6_ROUTER_PREF | 200 | #ifdef CONFIG_IPV6_ROUTER_PREF |
198 | .accept_ra_rtr_pref = 1, | 201 | .accept_ra_rtr_pref = 1, |
199 | .rtr_probe_interval = 60 * HZ, | 202 | .rtr_probe_interval = 60 * HZ, |
203 | #ifdef CONFIG_IPV6_ROUTE_INFO | ||
204 | .accept_ra_rt_info_max_plen = 0, | ||
205 | #endif | ||
200 | #endif | 206 | #endif |
201 | }; | 207 | }; |
202 | 208 | ||
@@ -3133,6 +3139,9 @@ static void inline ipv6_store_devconf(struct ipv6_devconf *cnf, | |||
3133 | #ifdef CONFIG_IPV6_ROUTER_PREF | 3139 | #ifdef CONFIG_IPV6_ROUTER_PREF |
3134 | array[DEVCONF_ACCEPT_RA_RTR_PREF] = cnf->accept_ra_rtr_pref; | 3140 | array[DEVCONF_ACCEPT_RA_RTR_PREF] = cnf->accept_ra_rtr_pref; |
3135 | array[DEVCONF_RTR_PROBE_INTERVAL] = cnf->rtr_probe_interval; | 3141 | array[DEVCONF_RTR_PROBE_INTERVAL] = cnf->rtr_probe_interval; |
3142 | #ifdef CONFIV_IPV6_ROUTE_INFO | ||
3143 | array[DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN] = cnf->accept_ra_rt_info_max_plen; | ||
3144 | #endif | ||
3136 | #endif | 3145 | #endif |
3137 | } | 3146 | } |
3138 | 3147 | ||
@@ -3620,6 +3629,16 @@ static struct addrconf_sysctl_table | |||
3620 | .proc_handler = &proc_dointvec_jiffies, | 3629 | .proc_handler = &proc_dointvec_jiffies, |
3621 | .strategy = &sysctl_jiffies, | 3630 | .strategy = &sysctl_jiffies, |
3622 | }, | 3631 | }, |
3632 | #ifdef CONFIV_IPV6_ROUTE_INFO | ||
3633 | { | ||
3634 | .ctl_name = NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN, | ||
3635 | .procname = "accept_ra_rt_info_max_plen", | ||
3636 | .data = &ipv6_devconf.accept_ra_rt_info_max_plen, | ||
3637 | .maxlen = sizeof(int), | ||
3638 | .mode = 0644, | ||
3639 | .proc_handler = &proc_dointvec, | ||
3640 | }, | ||
3641 | #endif | ||
3623 | #endif | 3642 | #endif |
3624 | { | 3643 | { |
3625 | .ctl_name = 0, /* sentinel */ | 3644 | .ctl_name = 0, /* sentinel */ |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 1f6256909674..dfa20d3be9b6 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -1214,11 +1214,13 @@ skip_defrtr: | |||
1214 | } | 1214 | } |
1215 | 1215 | ||
1216 | #ifdef CONFIG_IPV6_ROUTE_INFO | 1216 | #ifdef CONFIG_IPV6_ROUTE_INFO |
1217 | if (ndopts.nd_opts_ri) { | 1217 | if (in6_dev->cnf.accept_ra_rtr_pref && ndopts.nd_opts_ri) { |
1218 | struct nd_opt_hdr *p; | 1218 | struct nd_opt_hdr *p; |
1219 | for (p = ndopts.nd_opts_ri; | 1219 | for (p = ndopts.nd_opts_ri; |
1220 | p; | 1220 | p; |
1221 | p = ndisc_next_option(p, ndopts.nd_opts_ri_end)) { | 1221 | p = ndisc_next_option(p, ndopts.nd_opts_ri_end)) { |
1222 | if (((struct route_info *)p)->prefix_len > in6_dev->cnf.accept_ra_rt_info_max_plen) | ||
1223 | continue; | ||
1222 | rt6_route_rcv(skb->dev, (u8*)p, (p->nd_opt_len) << 3, | 1224 | rt6_route_rcv(skb->dev, (u8*)p, (p->nd_opt_len) << 3, |
1223 | &skb->nh.ipv6h->saddr); | 1225 | &skb->nh.ipv6h->saddr); |
1224 | } | 1226 | } |