aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2007-11-20 01:26:51 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:54:25 -0500
commit97c53cacf00d1f5aa04adabfebcc806ca8b22b10 (patch)
tree6b7223df312aa27a5017c4d7c4d1e500a33ed8d8 /net/ipv6
parentb854272b3c732316676e9128f7b9e6f1e1ff88b0 (diff)
[NET]: Make rtnetlink infrastructure network namespace aware (v3)
After this patch none of the netlink callback support anything except the initial network namespace but the rtnetlink infrastructure now handles multiple network namespaces. Changes from v2: - IPv6 addrlabel processing Changes from v1: - no need for special rtnl_unlock handling - fixed IPv6 ndisc Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/addrconf.c14
-rw-r--r--net/ipv6/addrlabel.c2
-rw-r--r--net/ipv6/ndisc.c5
-rw-r--r--net/ipv6/route.c6
4 files changed, 14 insertions, 13 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 26de8ee5095b..6c8b193474ba 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3397,7 +3397,7 @@ static int inet6_rtm_getaddr(struct sk_buff *in_skb, struct nlmsghdr* nlh,
3397 kfree_skb(skb); 3397 kfree_skb(skb);
3398 goto errout_ifa; 3398 goto errout_ifa;
3399 } 3399 }
3400 err = rtnl_unicast(skb, NETLINK_CB(in_skb).pid); 3400 err = rtnl_unicast(skb, &init_net, NETLINK_CB(in_skb).pid);
3401errout_ifa: 3401errout_ifa:
3402 in6_ifa_put(ifa); 3402 in6_ifa_put(ifa);
3403errout: 3403errout:
@@ -3420,10 +3420,10 @@ static void inet6_ifa_notify(int event, struct inet6_ifaddr *ifa)
3420 kfree_skb(skb); 3420 kfree_skb(skb);
3421 goto errout; 3421 goto errout;
3422 } 3422 }
3423 err = rtnl_notify(skb, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC); 3423 err = rtnl_notify(skb, &init_net, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC);
3424errout: 3424errout:
3425 if (err < 0) 3425 if (err < 0)
3426 rtnl_set_sk_err(RTNLGRP_IPV6_IFADDR, err); 3426 rtnl_set_sk_err(&init_net, RTNLGRP_IPV6_IFADDR, err);
3427} 3427}
3428 3428
3429static inline void ipv6_store_devconf(struct ipv6_devconf *cnf, 3429static inline void ipv6_store_devconf(struct ipv6_devconf *cnf,
@@ -3628,10 +3628,10 @@ void inet6_ifinfo_notify(int event, struct inet6_dev *idev)
3628 kfree_skb(skb); 3628 kfree_skb(skb);
3629 goto errout; 3629 goto errout;
3630 } 3630 }
3631 err = rtnl_notify(skb, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC); 3631 err = rtnl_notify(skb, &init_net, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC);
3632errout: 3632errout:
3633 if (err < 0) 3633 if (err < 0)
3634 rtnl_set_sk_err(RTNLGRP_IPV6_IFADDR, err); 3634 rtnl_set_sk_err(&init_net, RTNLGRP_IPV6_IFADDR, err);
3635} 3635}
3636 3636
3637static inline size_t inet6_prefix_nlmsg_size(void) 3637static inline size_t inet6_prefix_nlmsg_size(void)
@@ -3697,10 +3697,10 @@ static void inet6_prefix_notify(int event, struct inet6_dev *idev,
3697 kfree_skb(skb); 3697 kfree_skb(skb);
3698 goto errout; 3698 goto errout;
3699 } 3699 }
3700 err = rtnl_notify(skb, 0, RTNLGRP_IPV6_PREFIX, NULL, GFP_ATOMIC); 3700 err = rtnl_notify(skb, &init_net, 0, RTNLGRP_IPV6_PREFIX, NULL, GFP_ATOMIC);
3701errout: 3701errout:
3702 if (err < 0) 3702 if (err < 0)
3703 rtnl_set_sk_err(RTNLGRP_IPV6_PREFIX, err); 3703 rtnl_set_sk_err(&init_net, RTNLGRP_IPV6_PREFIX, err);
3704} 3704}
3705 3705
3706static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) 3706static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c
index b9b5d5707142..6f1ca607edda 100644
--- a/net/ipv6/addrlabel.c
+++ b/net/ipv6/addrlabel.c
@@ -549,7 +549,7 @@ static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr* nlh,
549 goto out; 549 goto out;
550 } 550 }
551 551
552 err = rtnl_unicast(skb, NETLINK_CB(in_skb).pid); 552 err = rtnl_unicast(skb, &init_net, NETLINK_CB(in_skb).pid);
553out: 553out:
554 return err; 554 return err;
555} 555}
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index b2531f80317e..b87f9d245e2e 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1049,7 +1049,8 @@ static void ndisc_ra_useropt(struct sk_buff *ra, struct nd_opt_hdr *opt)
1049 &ipv6_hdr(ra)->saddr); 1049 &ipv6_hdr(ra)->saddr);
1050 nlmsg_end(skb, nlh); 1050 nlmsg_end(skb, nlh);
1051 1051
1052 err = rtnl_notify(skb, 0, RTNLGRP_ND_USEROPT, NULL, GFP_ATOMIC); 1052 err = rtnl_notify(skb, &init_net, 0, RTNLGRP_ND_USEROPT, NULL,
1053 GFP_ATOMIC);
1053 if (err < 0) 1054 if (err < 0)
1054 goto errout; 1055 goto errout;
1055 1056
@@ -1059,7 +1060,7 @@ nla_put_failure:
1059 nlmsg_free(skb); 1060 nlmsg_free(skb);
1060 err = -EMSGSIZE; 1061 err = -EMSGSIZE;
1061errout: 1062errout:
1062 rtnl_set_sk_err(RTNLGRP_ND_USEROPT, err); 1063 rtnl_set_sk_err(&init_net, RTNLGRP_ND_USEROPT, err);
1063} 1064}
1064 1065
1065static void ndisc_router_discovery(struct sk_buff *skb) 1066static void ndisc_router_discovery(struct sk_buff *skb)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 5e1c5796761b..d7ec4c9ffc4b 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2230,7 +2230,7 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
2230 goto errout; 2230 goto errout;
2231 } 2231 }
2232 2232
2233 err = rtnl_unicast(skb, NETLINK_CB(in_skb).pid); 2233 err = rtnl_unicast(skb, &init_net, NETLINK_CB(in_skb).pid);
2234errout: 2234errout:
2235 return err; 2235 return err;
2236} 2236}
@@ -2260,10 +2260,10 @@ void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info)
2260 kfree_skb(skb); 2260 kfree_skb(skb);
2261 goto errout; 2261 goto errout;
2262 } 2262 }
2263 err = rtnl_notify(skb, pid, RTNLGRP_IPV6_ROUTE, nlh, gfp_any()); 2263 err = rtnl_notify(skb, &init_net, pid, RTNLGRP_IPV6_ROUTE, nlh, gfp_any());
2264errout: 2264errout:
2265 if (err < 0) 2265 if (err < 0)
2266 rtnl_set_sk_err(RTNLGRP_IPV6_ROUTE, err); 2266 rtnl_set_sk_err(&init_net, RTNLGRP_IPV6_ROUTE, err);
2267} 2267}
2268 2268
2269/* 2269/*