diff options
author | David S. Miller <davem@davemloft.net> | 2008-06-28 04:19:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-28 04:19:40 -0400 |
commit | 1b63ba8a86c85524a8d7e5953b314ce71ebcb9c9 (patch) | |
tree | fe3dc41cbb47ae12b7c3faf6a88b097349e50d5a /include/net | |
parent | e35c3269edba151e1c703d87068a28ce2cd65bb0 (diff) | |
parent | d420895efb259a78dda50f95289571faa6e10e41 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/iwlwifi/iwl4965-base.c
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ipv6.h | 6 | ||||
-rw-r--r-- | include/net/net_namespace.h | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 7f7db8d57934..c2222ee74d66 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -365,6 +365,12 @@ static inline int ipv6_addr_any(const struct in6_addr *a) | |||
365 | a->s6_addr32[2] | a->s6_addr32[3] ) == 0); | 365 | a->s6_addr32[2] | a->s6_addr32[3] ) == 0); |
366 | } | 366 | } |
367 | 367 | ||
368 | static inline int ipv6_addr_loopback(const struct in6_addr *a) | ||
369 | { | ||
370 | return ((a->s6_addr32[0] | a->s6_addr32[1] | | ||
371 | a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0); | ||
372 | } | ||
373 | |||
368 | static inline int ipv6_addr_v4mapped(const struct in6_addr *a) | 374 | static inline int ipv6_addr_v4mapped(const struct in6_addr *a) |
369 | { | 375 | { |
370 | return ((a->s6_addr32[0] | a->s6_addr32[1] | | 376 | return ((a->s6_addr32[0] | a->s6_addr32[1] | |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 8df751b3be55..f90443045c70 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -95,6 +95,11 @@ extern struct list_head net_namespace_list; | |||
95 | #ifdef CONFIG_NET_NS | 95 | #ifdef CONFIG_NET_NS |
96 | extern void __put_net(struct net *net); | 96 | extern void __put_net(struct net *net); |
97 | 97 | ||
98 | static inline int net_alive(struct net *net) | ||
99 | { | ||
100 | return net && atomic_read(&net->count); | ||
101 | } | ||
102 | |||
98 | static inline struct net *get_net(struct net *net) | 103 | static inline struct net *get_net(struct net *net) |
99 | { | 104 | { |
100 | atomic_inc(&net->count); | 105 | atomic_inc(&net->count); |
@@ -125,6 +130,12 @@ int net_eq(const struct net *net1, const struct net *net2) | |||
125 | return net1 == net2; | 130 | return net1 == net2; |
126 | } | 131 | } |
127 | #else | 132 | #else |
133 | |||
134 | static inline int net_alive(struct net *net) | ||
135 | { | ||
136 | return 1; | ||
137 | } | ||
138 | |||
128 | static inline struct net *get_net(struct net *net) | 139 | static inline struct net *get_net(struct net *net) |
129 | { | 140 | { |
130 | return net; | 141 | return net; |