diff options
author | Benjamin Thery <benjamin.thery@bull.net> | 2008-12-10 19:07:08 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-10 19:07:08 -0500 |
commit | bd91b8bf372911c1e4d66d6bb44fe409349a6791 (patch) | |
tree | 18a79fc3c86ad833523562d7b73a9a557207b51b /include | |
parent | 5eaa65b240c5eb7bf2235eb9dd177c83e6e3832c (diff) |
netns: ip6mr: allocate mroute6_socket per-namespace.
Preliminary work to make IPv6 multicast forwarding netns-aware.
Make IPv6 multicast forwarding mroute6_socket per-namespace,
moves it into struct netns_ipv6.
At the moment, mroute6_socket is only referenced in init_net.
Signed-off-by: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mroute6.h | 8 | ||||
-rw-r--r-- | include/net/netns/ipv6.h | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index 6f4c180179e2..2cd9901ee5c7 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
@@ -117,6 +117,7 @@ struct sioc_mif_req6 | |||
117 | 117 | ||
118 | #include <linux/pim.h> | 118 | #include <linux/pim.h> |
119 | #include <linux/skbuff.h> /* for struct sk_buff_head */ | 119 | #include <linux/skbuff.h> /* for struct sk_buff_head */ |
120 | #include <net/net_namespace.h> | ||
120 | 121 | ||
121 | #ifdef CONFIG_IPV6_MROUTE | 122 | #ifdef CONFIG_IPV6_MROUTE |
122 | static inline int ip6_mroute_opt(int opt) | 123 | static inline int ip6_mroute_opt(int opt) |
@@ -232,10 +233,13 @@ struct rtmsg; | |||
232 | extern int ip6mr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait); | 233 | extern int ip6mr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait); |
233 | 234 | ||
234 | #ifdef CONFIG_IPV6_MROUTE | 235 | #ifdef CONFIG_IPV6_MROUTE |
235 | extern struct sock *mroute6_socket; | 236 | static inline struct sock *mroute6_socket(struct net *net) |
237 | { | ||
238 | return net->ipv6.mroute6_sk; | ||
239 | } | ||
236 | extern int ip6mr_sk_done(struct sock *sk); | 240 | extern int ip6mr_sk_done(struct sock *sk); |
237 | #else | 241 | #else |
238 | #define mroute6_socket NULL | 242 | static inline struct sock *mroute6_socket(struct net *net) { return NULL; } |
239 | static inline int ip6mr_sk_done(struct sock *sk) { return 0; } | 243 | static inline int ip6mr_sk_done(struct sock *sk) { return 0; } |
240 | #endif | 244 | #endif |
241 | #endif | 245 | #endif |
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index 2932721180c0..8a0a67d073b3 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
@@ -55,5 +55,8 @@ struct netns_ipv6 { | |||
55 | struct sock *ndisc_sk; | 55 | struct sock *ndisc_sk; |
56 | struct sock *tcp_sk; | 56 | struct sock *tcp_sk; |
57 | struct sock *igmp_sk; | 57 | struct sock *igmp_sk; |
58 | #ifdef CONFIG_IPV6_MROUTE | ||
59 | struct sock *mroute6_sk; | ||
60 | #endif | ||
58 | }; | 61 | }; |
59 | #endif | 62 | #endif |