diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-07-20 01:35:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-20 01:35:03 -0400 |
commit | 53b7997fd5c62408d10b9aafb38974ce90fd2356 (patch) | |
tree | bc23e6ec248a6d999cdc779abdfdc843c5640197 /net/ipv6 | |
parent | 721499e8931c5732202481ae24f2dfbf9910f129 (diff) |
ipv6 netns: Make several "global" sysctl variables namespace aware.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 8 | ||||
-rw-r--r-- | net/ipv6/anycast.c | 2 | ||||
-rw-r--r-- | net/ipv6/exthdrs.c | 2 | ||||
-rw-r--r-- | net/ipv6/ip6_input.c | 2 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 4 | ||||
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 2 | ||||
-rw-r--r-- | net/ipv6/mcast.c | 2 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 11 | ||||
-rw-r--r-- | net/ipv6/route.c | 4 |
9 files changed, 21 insertions, 16 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 30184e0dd74c..580ae506c399 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -1863,6 +1863,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len) | |||
1863 | struct inet6_ifaddr * ifp; | 1863 | struct inet6_ifaddr * ifp; |
1864 | struct in6_addr addr; | 1864 | struct in6_addr addr; |
1865 | int create = 0, update_lft = 0; | 1865 | int create = 0, update_lft = 0; |
1866 | struct net *net = dev_net(dev); | ||
1866 | 1867 | ||
1867 | if (pinfo->prefix_len == 64) { | 1868 | if (pinfo->prefix_len == 64) { |
1868 | memcpy(&addr, &pinfo->prefix, 8); | 1869 | memcpy(&addr, &pinfo->prefix, 8); |
@@ -1881,7 +1882,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len) | |||
1881 | 1882 | ||
1882 | ok: | 1883 | ok: |
1883 | 1884 | ||
1884 | ifp = ipv6_get_ifaddr(dev_net(dev), &addr, dev, 1); | 1885 | ifp = ipv6_get_ifaddr(net, &addr, dev, 1); |
1885 | 1886 | ||
1886 | if (ifp == NULL && valid_lft) { | 1887 | if (ifp == NULL && valid_lft) { |
1887 | int max_addresses = in6_dev->cnf.max_addresses; | 1888 | int max_addresses = in6_dev->cnf.max_addresses; |
@@ -1889,7 +1890,7 @@ ok: | |||
1889 | 1890 | ||
1890 | #ifdef CONFIG_IPV6_OPTIMISTIC_DAD | 1891 | #ifdef CONFIG_IPV6_OPTIMISTIC_DAD |
1891 | if (in6_dev->cnf.optimistic_dad && | 1892 | if (in6_dev->cnf.optimistic_dad && |
1892 | !ipv6_devconf.forwarding) | 1893 | !net->ipv6.devconf_all->forwarding) |
1893 | addr_flags = IFA_F_OPTIMISTIC; | 1894 | addr_flags = IFA_F_OPTIMISTIC; |
1894 | #endif | 1895 | #endif |
1895 | 1896 | ||
@@ -2314,11 +2315,12 @@ static void init_loopback(struct net_device *dev) | |||
2314 | static void addrconf_add_linklocal(struct inet6_dev *idev, struct in6_addr *addr) | 2315 | static void addrconf_add_linklocal(struct inet6_dev *idev, struct in6_addr *addr) |
2315 | { | 2316 | { |
2316 | struct inet6_ifaddr * ifp; | 2317 | struct inet6_ifaddr * ifp; |
2318 | struct net *net = dev_net(idev->dev); | ||
2317 | u32 addr_flags = IFA_F_PERMANENT; | 2319 | u32 addr_flags = IFA_F_PERMANENT; |
2318 | 2320 | ||
2319 | #ifdef CONFIG_IPV6_OPTIMISTIC_DAD | 2321 | #ifdef CONFIG_IPV6_OPTIMISTIC_DAD |
2320 | if (idev->cnf.optimistic_dad && | 2322 | if (idev->cnf.optimistic_dad && |
2321 | !ipv6_devconf.forwarding) | 2323 | !net->ipv6.devconf_all->forwarding) |
2322 | addr_flags |= IFA_F_OPTIMISTIC; | 2324 | addr_flags |= IFA_F_OPTIMISTIC; |
2323 | #endif | 2325 | #endif |
2324 | 2326 | ||
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index 4e1b29fabdf0..8336cd81cb4f 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c | |||
@@ -60,7 +60,7 @@ int ipv6_sock_ac_join(struct sock *sk, int ifindex, struct in6_addr *addr) | |||
60 | struct inet6_dev *idev; | 60 | struct inet6_dev *idev; |
61 | struct ipv6_ac_socklist *pac; | 61 | struct ipv6_ac_socklist *pac; |
62 | struct net *net = sock_net(sk); | 62 | struct net *net = sock_net(sk); |
63 | int ishost = !ipv6_devconf.forwarding; | 63 | int ishost = !net->ipv6.devconf_all->forwarding; |
64 | int err = 0; | 64 | int err = 0; |
65 | 65 | ||
66 | if (!capable(CAP_NET_ADMIN)) | 66 | if (!capable(CAP_NET_ADMIN)) |
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 9f1084b4c0e8..837c830d6d8e 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c | |||
@@ -319,7 +319,7 @@ static int ipv6_rthdr_rcv(struct sk_buff *skb) | |||
319 | int n, i; | 319 | int n, i; |
320 | struct ipv6_rt_hdr *hdr; | 320 | struct ipv6_rt_hdr *hdr; |
321 | struct rt0_hdr *rthdr; | 321 | struct rt0_hdr *rthdr; |
322 | int accept_source_route = ipv6_devconf.accept_source_route; | 322 | int accept_source_route = dev_net(skb->dev)->ipv6.devconf_all->accept_source_route; |
323 | 323 | ||
324 | idev = in6_dev_get(skb->dev); | 324 | idev = in6_dev_get(skb->dev); |
325 | if (idev) { | 325 | if (idev) { |
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index ea81c614dde2..7e14cccd0561 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c | |||
@@ -249,7 +249,7 @@ int ip6_mc_input(struct sk_buff *skb) | |||
249 | /* | 249 | /* |
250 | * IPv6 multicast router mode is now supported ;) | 250 | * IPv6 multicast router mode is now supported ;) |
251 | */ | 251 | */ |
252 | if (ipv6_devconf.mc_forwarding && | 252 | if (dev_net(skb->dev)->ipv6.devconf_all->mc_forwarding && |
253 | likely(!(IP6CB(skb)->flags & IP6SKB_FORWARDED))) { | 253 | likely(!(IP6CB(skb)->flags & IP6SKB_FORWARDED))) { |
254 | /* | 254 | /* |
255 | * Okay, we try to forward - split and duplicate | 255 | * Okay, we try to forward - split and duplicate |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 0981c1ef3057..6407c64ea4a5 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -411,7 +411,7 @@ int ip6_forward(struct sk_buff *skb) | |||
411 | struct inet6_skb_parm *opt = IP6CB(skb); | 411 | struct inet6_skb_parm *opt = IP6CB(skb); |
412 | struct net *net = dev_net(dst->dev); | 412 | struct net *net = dev_net(dst->dev); |
413 | 413 | ||
414 | if (ipv6_devconf.forwarding == 0) | 414 | if (net->ipv6.devconf_all->forwarding == 0) |
415 | goto error; | 415 | goto error; |
416 | 416 | ||
417 | if (skb_warn_if_lro(skb)) | 417 | if (skb_warn_if_lro(skb)) |
@@ -458,7 +458,7 @@ int ip6_forward(struct sk_buff *skb) | |||
458 | } | 458 | } |
459 | 459 | ||
460 | /* XXX: idev->cnf.proxy_ndp? */ | 460 | /* XXX: idev->cnf.proxy_ndp? */ |
461 | if (ipv6_devconf.proxy_ndp && | 461 | if (net->ipv6.devconf_all->proxy_ndp && |
462 | pneigh_lookup(&nd_tbl, net, &hdr->daddr, skb->dev, 0)) { | 462 | pneigh_lookup(&nd_tbl, net, &hdr->daddr, skb->dev, 0)) { |
463 | int proxied = ip6_forward_proxy_check(skb); | 463 | int proxied = ip6_forward_proxy_check(skb); |
464 | if (proxied > 0) | 464 | if (proxied > 0) |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 8c6ea07f4d56..ea33b26512c2 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -1038,7 +1038,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
1038 | dst_release(dst); | 1038 | dst_release(dst); |
1039 | } | 1039 | } |
1040 | if (val < 0) | 1040 | if (val < 0) |
1041 | val = ipv6_devconf.hop_limit; | 1041 | val = sock_net(sk)->ipv6.devconf_all->hop_limit; |
1042 | break; | 1042 | break; |
1043 | } | 1043 | } |
1044 | 1044 | ||
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index bd2fe4cfafa7..1b285371124a 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -151,7 +151,7 @@ static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, | |||
151 | #define IGMP6_UNSOLICITED_IVAL (10*HZ) | 151 | #define IGMP6_UNSOLICITED_IVAL (10*HZ) |
152 | #define MLD_QRV_DEFAULT 2 | 152 | #define MLD_QRV_DEFAULT 2 |
153 | 153 | ||
154 | #define MLD_V1_SEEN(idev) (ipv6_devconf.force_mld_version == 1 || \ | 154 | #define MLD_V1_SEEN(idev) (dev_net((idev)->dev)->ipv6.devconf_all->force_mld_version == 1 || \ |
155 | (idev)->cnf.force_mld_version == 1 || \ | 155 | (idev)->cnf.force_mld_version == 1 || \ |
156 | ((idev)->mc_v1_seen && \ | 156 | ((idev)->mc_v1_seen && \ |
157 | time_before(jiffies, (idev)->mc_v1_seen))) | 157 | time_before(jiffies, (idev)->mc_v1_seen))) |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 282fdb31f8ed..beb48e3f038a 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -784,15 +784,17 @@ static void ndisc_recv_ns(struct sk_buff *skb) | |||
784 | 784 | ||
785 | idev = ifp->idev; | 785 | idev = ifp->idev; |
786 | } else { | 786 | } else { |
787 | struct net *net = dev_net(dev); | ||
788 | |||
787 | idev = in6_dev_get(dev); | 789 | idev = in6_dev_get(dev); |
788 | if (!idev) { | 790 | if (!idev) { |
789 | /* XXX: count this drop? */ | 791 | /* XXX: count this drop? */ |
790 | return; | 792 | return; |
791 | } | 793 | } |
792 | 794 | ||
793 | if (ipv6_chk_acast_addr(dev_net(dev), dev, &msg->target) || | 795 | if (ipv6_chk_acast_addr(net, dev, &msg->target) || |
794 | (idev->cnf.forwarding && | 796 | (idev->cnf.forwarding && |
795 | (ipv6_devconf.proxy_ndp || idev->cnf.proxy_ndp) && | 797 | (net->ipv6.devconf_all->proxy_ndp || idev->cnf.proxy_ndp) && |
796 | (is_router = pndisc_is_router(&msg->target, dev)) >= 0)) { | 798 | (is_router = pndisc_is_router(&msg->target, dev)) >= 0)) { |
797 | if (!(NEIGH_CB(skb)->flags & LOCALLY_ENQUEUED) && | 799 | if (!(NEIGH_CB(skb)->flags & LOCALLY_ENQUEUED) && |
798 | skb->pkt_type != PACKET_HOST && | 800 | skb->pkt_type != PACKET_HOST && |
@@ -921,6 +923,7 @@ static void ndisc_recv_na(struct sk_buff *skb) | |||
921 | 923 | ||
922 | if (neigh) { | 924 | if (neigh) { |
923 | u8 old_flags = neigh->flags; | 925 | u8 old_flags = neigh->flags; |
926 | struct net *net = dev_net(dev); | ||
924 | 927 | ||
925 | if (neigh->nud_state & NUD_FAILED) | 928 | if (neigh->nud_state & NUD_FAILED) |
926 | goto out; | 929 | goto out; |
@@ -931,8 +934,8 @@ static void ndisc_recv_na(struct sk_buff *skb) | |||
931 | * has already sent a NA to us. | 934 | * has already sent a NA to us. |
932 | */ | 935 | */ |
933 | if (lladdr && !memcmp(lladdr, dev->dev_addr, dev->addr_len) && | 936 | if (lladdr && !memcmp(lladdr, dev->dev_addr, dev->addr_len) && |
934 | ipv6_devconf.forwarding && ipv6_devconf.proxy_ndp && | 937 | net->ipv6.devconf_all->forwarding && net->ipv6.devconf_all->proxy_ndp && |
935 | pneigh_lookup(&nd_tbl, dev_net(dev), &msg->target, dev, 0)) { | 938 | pneigh_lookup(&nd_tbl, net, &msg->target, dev, 0)) { |
936 | /* XXX: idev->cnf.prixy_ndp */ | 939 | /* XXX: idev->cnf.prixy_ndp */ |
937 | goto out; | 940 | goto out; |
938 | } | 941 | } |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index cb8a51271b67..615b328de251 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -676,7 +676,7 @@ static struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table, | |||
676 | int strict = 0; | 676 | int strict = 0; |
677 | int attempts = 3; | 677 | int attempts = 3; |
678 | int err; | 678 | int err; |
679 | int reachable = ipv6_devconf.forwarding ? 0 : RT6_LOOKUP_F_REACHABLE; | 679 | int reachable = net->ipv6.devconf_all->forwarding ? 0 : RT6_LOOKUP_F_REACHABLE; |
680 | 680 | ||
681 | strict |= flags & RT6_LOOKUP_F_IFACE; | 681 | strict |= flags & RT6_LOOKUP_F_IFACE; |
682 | 682 | ||
@@ -1058,7 +1058,7 @@ int ip6_dst_hoplimit(struct dst_entry *dst) | |||
1058 | hoplimit = idev->cnf.hop_limit; | 1058 | hoplimit = idev->cnf.hop_limit; |
1059 | in6_dev_put(idev); | 1059 | in6_dev_put(idev); |
1060 | } else | 1060 | } else |
1061 | hoplimit = ipv6_devconf.hop_limit; | 1061 | hoplimit = dev_net(dev)->ipv6.devconf_all->hop_limit; |
1062 | } | 1062 | } |
1063 | return hoplimit; | 1063 | return hoplimit; |
1064 | } | 1064 | } |