diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2012-09-10 18:09:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-18 15:57:03 -0400 |
commit | b42664f898c976247f7f609b8bb9c94d7475ca10 (patch) | |
tree | b98e4d5d57b21d0a9dc8882bdc29e7cc7c6beccf /include/net/net_namespace.h | |
parent | 2885da72966fcb89f48d554339d347fb02b5ea78 (diff) |
netns: move net->ipv4.rt_genid to net->rt_genid
This commit prepares the use of rt_genid by both IPv4 and IPv6.
Initialization is left in IPv4 part.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/net_namespace.h')
-rw-r--r-- | include/net/net_namespace.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index ae1cd6c9ba52..fd87963a0ea5 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -102,6 +102,7 @@ struct net { | |||
102 | #endif | 102 | #endif |
103 | struct netns_ipvs *ipvs; | 103 | struct netns_ipvs *ipvs; |
104 | struct sock *diag_nlsk; | 104 | struct sock *diag_nlsk; |
105 | atomic_t rt_genid; | ||
105 | }; | 106 | }; |
106 | 107 | ||
107 | 108 | ||
@@ -300,5 +301,14 @@ static inline void unregister_net_sysctl_table(struct ctl_table_header *header) | |||
300 | } | 301 | } |
301 | #endif | 302 | #endif |
302 | 303 | ||
304 | static inline int rt_genid(struct net *net) | ||
305 | { | ||
306 | return atomic_read(&net->rt_genid); | ||
307 | } | ||
308 | |||
309 | static inline void rt_genid_bump(struct net *net) | ||
310 | { | ||
311 | atomic_inc(&net->rt_genid); | ||
312 | } | ||
303 | 313 | ||
304 | #endif /* __NET_NET_NAMESPACE_H */ | 314 | #endif /* __NET_NET_NAMESPACE_H */ |