diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2006-03-20 19:55:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-20 19:55:26 -0500 |
commit | c4fd30eb18666972230689eb30e8f90844bce635 (patch) | |
tree | f1b8daddeb21d7d1390fa1ae820bf2b5ffa8d276 /net | |
parent | 65f5c7c1143fb8eed5bc7e7d8c926346e00fe3c0 (diff) |
[IPV6]: ADDRCONF: Add accept_ra_pinfo sysctl.
This controls whether we accept Prefix 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')
-rw-r--r-- | net/ipv6/addrconf.c | 11 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index fbcdcc6ba93b..631b51d0ccbc 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -166,6 +166,7 @@ struct ipv6_devconf ipv6_devconf = { | |||
166 | #endif | 166 | #endif |
167 | .max_addresses = IPV6_MAX_ADDRESSES, | 167 | .max_addresses = IPV6_MAX_ADDRESSES, |
168 | .accept_ra_defrtr = 1, | 168 | .accept_ra_defrtr = 1, |
169 | .accept_ra_pinfo = 1, | ||
169 | }; | 170 | }; |
170 | 171 | ||
171 | static struct ipv6_devconf ipv6_devconf_dflt = { | 172 | static struct ipv6_devconf ipv6_devconf_dflt = { |
@@ -188,6 +189,7 @@ static struct ipv6_devconf ipv6_devconf_dflt = { | |||
188 | #endif | 189 | #endif |
189 | .max_addresses = IPV6_MAX_ADDRESSES, | 190 | .max_addresses = IPV6_MAX_ADDRESSES, |
190 | .accept_ra_defrtr = 1, | 191 | .accept_ra_defrtr = 1, |
192 | .accept_ra_pinfo = 1, | ||
191 | }; | 193 | }; |
192 | 194 | ||
193 | /* IPv6 Wildcard Address and Loopback Address defined by RFC2553 */ | 195 | /* IPv6 Wildcard Address and Loopback Address defined by RFC2553 */ |
@@ -3119,6 +3121,7 @@ static void inline ipv6_store_devconf(struct ipv6_devconf *cnf, | |||
3119 | #endif | 3121 | #endif |
3120 | array[DEVCONF_MAX_ADDRESSES] = cnf->max_addresses; | 3122 | array[DEVCONF_MAX_ADDRESSES] = cnf->max_addresses; |
3121 | array[DEVCONF_ACCEPT_RA_DEFRTR] = cnf->accept_ra_defrtr; | 3123 | array[DEVCONF_ACCEPT_RA_DEFRTR] = cnf->accept_ra_defrtr; |
3124 | array[DEVCONF_ACCEPT_RA_PINFO] = cnf->accept_ra_pinfo; | ||
3122 | } | 3125 | } |
3123 | 3126 | ||
3124 | static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev, | 3127 | static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev, |
@@ -3580,6 +3583,14 @@ static struct addrconf_sysctl_table | |||
3580 | .proc_handler = &proc_dointvec, | 3583 | .proc_handler = &proc_dointvec, |
3581 | }, | 3584 | }, |
3582 | { | 3585 | { |
3586 | .ctl_name = NET_IPV6_ACCEPT_RA_PINFO, | ||
3587 | .procname = "accept_ra_pinfo", | ||
3588 | .data = &ipv6_devconf.accept_ra_pinfo, | ||
3589 | .maxlen = sizeof(int), | ||
3590 | .mode = 0644, | ||
3591 | .proc_handler = &proc_dointvec, | ||
3592 | }, | ||
3593 | { | ||
3583 | .ctl_name = 0, /* sentinel */ | 3594 | .ctl_name = 0, /* sentinel */ |
3584 | } | 3595 | } |
3585 | }, | 3596 | }, |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index e17116796059..3b56be85234e 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -1191,7 +1191,7 @@ skip_defrtr: | |||
1191 | NEIGH_UPDATE_F_ISROUTER); | 1191 | NEIGH_UPDATE_F_ISROUTER); |
1192 | } | 1192 | } |
1193 | 1193 | ||
1194 | if (ndopts.nd_opts_pi) { | 1194 | if (in6_dev->cnf.accept_ra_pinfo && ndopts.nd_opts_pi) { |
1195 | struct nd_opt_hdr *p; | 1195 | struct nd_opt_hdr *p; |
1196 | for (p = ndopts.nd_opts_pi; | 1196 | for (p = ndopts.nd_opts_pi; |
1197 | p; | 1197 | p; |