diff options
-rw-r--r-- | Documentation/networking/ip-sysctl.txt | 10 | ||||
-rw-r--r-- | include/linux/ipv6.h | 2 | ||||
-rw-r--r-- | include/linux/sysctl.h | 1 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 11 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 2 |
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 | ||
726 | accept_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 | |||
726 | accept_redirects - BOOLEAN | 732 | accept_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 | ||
739 | dad_transmits - INTEGER | 745 | dad_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 | ||
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; |