diff options
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r-- | net/ipv6/addrconf.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index a7fee6b27320..452a82ce4796 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -172,6 +172,7 @@ struct ipv6_devconf ipv6_devconf __read_mostly = { | |||
172 | #endif | 172 | #endif |
173 | #endif | 173 | #endif |
174 | .proxy_ndp = 0, | 174 | .proxy_ndp = 0, |
175 | .accept_source_route = 0, /* we do not accept RH0 by default. */ | ||
175 | }; | 176 | }; |
176 | 177 | ||
177 | static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = { | 178 | static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = { |
@@ -203,6 +204,7 @@ static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = { | |||
203 | #endif | 204 | #endif |
204 | #endif | 205 | #endif |
205 | .proxy_ndp = 0, | 206 | .proxy_ndp = 0, |
207 | .accept_source_route = 0, /* we do not accept RH0 by default. */ | ||
206 | }; | 208 | }; |
207 | 209 | ||
208 | /* IPv6 Wildcard Address and Loopback Address defined by RFC2553 */ | 210 | /* IPv6 Wildcard Address and Loopback Address defined by RFC2553 */ |
@@ -342,6 +344,9 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) | |||
342 | } | 344 | } |
343 | #endif | 345 | #endif |
344 | 346 | ||
347 | if (netif_running(dev) && netif_carrier_ok(dev)) | ||
348 | ndev->if_flags |= IF_READY; | ||
349 | |||
345 | ipv6_mc_init_dev(ndev); | 350 | ipv6_mc_init_dev(ndev); |
346 | ndev->tstamp = jiffies; | 351 | ndev->tstamp = jiffies; |
347 | #ifdef CONFIG_SYSCTL | 352 | #ifdef CONFIG_SYSCTL |
@@ -804,7 +809,7 @@ struct ipv6_saddr_score { | |||
804 | #define IPV6_SADDR_SCORE_LABEL 0x0020 | 809 | #define IPV6_SADDR_SCORE_LABEL 0x0020 |
805 | #define IPV6_SADDR_SCORE_PRIVACY 0x0040 | 810 | #define IPV6_SADDR_SCORE_PRIVACY 0x0040 |
806 | 811 | ||
807 | static int inline ipv6_saddr_preferred(int type) | 812 | static inline int ipv6_saddr_preferred(int type) |
808 | { | 813 | { |
809 | if (type & (IPV6_ADDR_MAPPED|IPV6_ADDR_COMPATv4| | 814 | if (type & (IPV6_ADDR_MAPPED|IPV6_ADDR_COMPATv4| |
810 | IPV6_ADDR_LOOPBACK|IPV6_ADDR_RESERVED)) | 815 | IPV6_ADDR_LOOPBACK|IPV6_ADDR_RESERVED)) |
@@ -813,7 +818,7 @@ static int inline ipv6_saddr_preferred(int type) | |||
813 | } | 818 | } |
814 | 819 | ||
815 | /* static matching label */ | 820 | /* static matching label */ |
816 | static int inline ipv6_saddr_label(const struct in6_addr *addr, int type) | 821 | static inline int ipv6_saddr_label(const struct in6_addr *addr, int type) |
817 | { | 822 | { |
818 | /* | 823 | /* |
819 | * prefix (longest match) label | 824 | * prefix (longest match) label |
@@ -3318,7 +3323,7 @@ errout: | |||
3318 | rtnl_set_sk_err(RTNLGRP_IPV6_IFADDR, err); | 3323 | rtnl_set_sk_err(RTNLGRP_IPV6_IFADDR, err); |
3319 | } | 3324 | } |
3320 | 3325 | ||
3321 | static void inline ipv6_store_devconf(struct ipv6_devconf *cnf, | 3326 | static inline void ipv6_store_devconf(struct ipv6_devconf *cnf, |
3322 | __s32 *array, int bytes) | 3327 | __s32 *array, int bytes) |
3323 | { | 3328 | { |
3324 | BUG_ON(bytes < (DEVCONF_MAX * 4)); | 3329 | BUG_ON(bytes < (DEVCONF_MAX * 4)); |
@@ -3353,6 +3358,7 @@ static void inline ipv6_store_devconf(struct ipv6_devconf *cnf, | |||
3353 | #endif | 3358 | #endif |
3354 | #endif | 3359 | #endif |
3355 | array[DEVCONF_PROXY_NDP] = cnf->proxy_ndp; | 3360 | array[DEVCONF_PROXY_NDP] = cnf->proxy_ndp; |
3361 | array[DEVCONF_ACCEPT_SOURCE_ROUTE] = cnf->accept_source_route; | ||
3356 | } | 3362 | } |
3357 | 3363 | ||
3358 | static inline size_t inet6_if_nlmsg_size(void) | 3364 | static inline size_t inet6_if_nlmsg_size(void) |
@@ -3881,6 +3887,14 @@ static struct addrconf_sysctl_table | |||
3881 | .proc_handler = &proc_dointvec, | 3887 | .proc_handler = &proc_dointvec, |
3882 | }, | 3888 | }, |
3883 | { | 3889 | { |
3890 | .ctl_name = NET_IPV6_ACCEPT_SOURCE_ROUTE, | ||
3891 | .procname = "accept_source_route", | ||
3892 | .data = &ipv6_devconf.accept_source_route, | ||
3893 | .maxlen = sizeof(int), | ||
3894 | .mode = 0644, | ||
3895 | .proc_handler = &proc_dointvec, | ||
3896 | }, | ||
3897 | { | ||
3884 | .ctl_name = 0, /* sentinel */ | 3898 | .ctl_name = 0, /* sentinel */ |
3885 | } | 3899 | } |
3886 | }, | 3900 | }, |