diff options
Diffstat (limited to 'include/linux/mroute6.h')
-rw-r--r-- | include/linux/mroute6.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index 6f4c180179e..5375faca1f7 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) |
@@ -187,6 +188,9 @@ struct mif_device | |||
187 | struct mfc6_cache | 188 | struct mfc6_cache |
188 | { | 189 | { |
189 | struct mfc6_cache *next; /* Next entry on cache line */ | 190 | struct mfc6_cache *next; /* Next entry on cache line */ |
191 | #ifdef CONFIG_NET_NS | ||
192 | struct net *mfc6_net; | ||
193 | #endif | ||
190 | struct in6_addr mf6c_mcastgrp; /* Group the entry belongs to */ | 194 | struct in6_addr mf6c_mcastgrp; /* Group the entry belongs to */ |
191 | struct in6_addr mf6c_origin; /* Source of packet */ | 195 | struct in6_addr mf6c_origin; /* Source of packet */ |
192 | mifi_t mf6c_parent; /* Source interface */ | 196 | mifi_t mf6c_parent; /* Source interface */ |
@@ -209,6 +213,18 @@ struct mfc6_cache | |||
209 | } mfc_un; | 213 | } mfc_un; |
210 | }; | 214 | }; |
211 | 215 | ||
216 | static inline | ||
217 | struct net *mfc6_net(const struct mfc6_cache *mfc) | ||
218 | { | ||
219 | return read_pnet(&mfc->mfc6_net); | ||
220 | } | ||
221 | |||
222 | static inline | ||
223 | void mfc6_net_set(struct mfc6_cache *mfc, struct net *net) | ||
224 | { | ||
225 | write_pnet(&mfc->mfc6_net, hold_net(net)); | ||
226 | } | ||
227 | |||
212 | #define MFC_STATIC 1 | 228 | #define MFC_STATIC 1 |
213 | #define MFC_NOTIFY 2 | 229 | #define MFC_NOTIFY 2 |
214 | 230 | ||
@@ -229,13 +245,17 @@ struct mfc6_cache | |||
229 | 245 | ||
230 | #ifdef __KERNEL__ | 246 | #ifdef __KERNEL__ |
231 | struct rtmsg; | 247 | struct rtmsg; |
232 | extern int ip6mr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait); | 248 | extern int ip6mr_get_route(struct net *net, struct sk_buff *skb, |
249 | struct rtmsg *rtm, int nowait); | ||
233 | 250 | ||
234 | #ifdef CONFIG_IPV6_MROUTE | 251 | #ifdef CONFIG_IPV6_MROUTE |
235 | extern struct sock *mroute6_socket; | 252 | static inline struct sock *mroute6_socket(struct net *net) |
253 | { | ||
254 | return net->ipv6.mroute6_sk; | ||
255 | } | ||
236 | extern int ip6mr_sk_done(struct sock *sk); | 256 | extern int ip6mr_sk_done(struct sock *sk); |
237 | #else | 257 | #else |
238 | #define mroute6_socket NULL | 258 | static inline struct sock *mroute6_socket(struct net *net) { return NULL; } |
239 | static inline int ip6mr_sk_done(struct sock *sk) { return 0; } | 259 | static inline int ip6mr_sk_done(struct sock *sk) { return 0; } |
240 | #endif | 260 | #endif |
241 | #endif | 261 | #endif |