aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2006-03-20 19:55:26 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-20 19:55:26 -0500
commitc4fd30eb18666972230689eb30e8f90844bce635 (patch)
treef1b8daddeb21d7d1390fa1ae820bf2b5ffa8d276
parent65f5c7c1143fb8eed5bc7e7d8c926346e00fe3c0 (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>
-rw-r--r--Documentation/networking/ip-sysctl.txt10
-rw-r--r--include/linux/ipv6.h2
-rw-r--r--include/linux/sysctl.h1
-rw-r--r--net/ipv6/addrconf.c11
-rw-r--r--net/ipv6/ndisc.c2
5 files changed, 23 insertions, 3 deletions
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 8001faa76ea2..404afacb468d 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -723,6 +723,12 @@ accept_ra_defrtr - BOOLEAN
723 Functional default: enabled if accept_ra is enabled. 723 Functional default: enabled if accept_ra is enabled.
724 disabled if accept_ra is disabled. 724 disabled if accept_ra is disabled.
725 725
726accept_ra_pinfo - BOOLEAN
727 Learn Prefix Inforamtion in Router Advertisement.
728
729 Functional default: enabled if accept_ra is enabled.
730 disabled if accept_ra is disabled.
731
726accept_redirects - BOOLEAN 732accept_redirects - BOOLEAN
727 Accept Redirects. 733 Accept Redirects.
728 734
@@ -733,8 +739,8 @@ autoconf - BOOLEAN
733 Autoconfigure addresses using Prefix Information in Router 739 Autoconfigure addresses using Prefix Information in Router
734 Advertisements. 740 Advertisements.
735 741
736 Functional default: enabled if accept_ra is enabled. 742 Functional default: enabled if accept_ra_pinfo is enabled.
737 disabled if accept_ra is disabled. 743 disabled if accept_ra_pinfo is disabled.
738 744
739dad_transmits - INTEGER 745dad_transmits - INTEGER
740 The amount of Duplicate Address Detection probes to send. 746 The amount of Duplicate Address Detection probes to send.
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index c5131a02869a..2c3b799480c5 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -146,6 +146,7 @@ struct ipv6_devconf {
146#endif 146#endif
147 __s32 max_addresses; 147 __s32 max_addresses;
148 __s32 accept_ra_defrtr; 148 __s32 accept_ra_defrtr;
149 __s32 accept_ra_pinfo;
149 void *sysctl; 150 void *sysctl;
150}; 151};
151 152
@@ -169,6 +170,7 @@ enum {
169 DEVCONF_MAX_ADDRESSES, 170 DEVCONF_MAX_ADDRESSES,
170 DEVCONF_FORCE_MLD_VERSION, 171 DEVCONF_FORCE_MLD_VERSION,
171 DEVCONF_ACCEPT_RA_DEFRTR, 172 DEVCONF_ACCEPT_RA_DEFRTR,
173 DEVCONF_ACCEPT_RA_PINFO,
172 DEVCONF_MAX 174 DEVCONF_MAX
173}; 175};
174 176
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 0f494137d037..09378ea505bd 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -532,6 +532,7 @@ enum {
532 NET_IPV6_MAX_ADDRESSES=16, 532 NET_IPV6_MAX_ADDRESSES=16,
533 NET_IPV6_FORCE_MLD_VERSION=17, 533 NET_IPV6_FORCE_MLD_VERSION=17,
534 NET_IPV6_ACCEPT_RA_DEFRTR=18, 534 NET_IPV6_ACCEPT_RA_DEFRTR=18,
535 NET_IPV6_ACCEPT_RA_PINFO=19,
535 __NET_IPV6_MAX 536 __NET_IPV6_MAX
536}; 537};
537 538
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
171static struct ipv6_devconf ipv6_devconf_dflt = { 172static 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
3124static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev, 3127static 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;