aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/inet_hashtables.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/inet_hashtables.h')
-rw-r--r--include/net/inet_hashtables.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index d522dcf3031a..41cbddd25b70 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -92,8 +92,8 @@ static inline struct net *ib_net(struct inet_bind_bucket *ib)
92 return read_pnet(&ib->ib_net); 92 return read_pnet(&ib->ib_net);
93} 93}
94 94
95#define inet_bind_bucket_for_each(tb, node, head) \ 95#define inet_bind_bucket_for_each(tb, pos, head) \
96 hlist_for_each_entry(tb, node, head, node) 96 hlist_for_each_entry(tb, pos, head, node)
97 97
98struct inet_bind_hashbucket { 98struct inet_bind_hashbucket {
99 spinlock_t lock; 99 spinlock_t lock;
@@ -125,7 +125,7 @@ struct inet_hashinfo {
125 */ 125 */
126 struct inet_ehash_bucket *ehash; 126 struct inet_ehash_bucket *ehash;
127 spinlock_t *ehash_locks; 127 spinlock_t *ehash_locks;
128 unsigned int ehash_size; 128 unsigned int ehash_mask;
129 unsigned int ehash_locks_mask; 129 unsigned int ehash_locks_mask;
130 130
131 /* Ok, let's try this, I give up, we do need a local binding 131 /* Ok, let's try this, I give up, we do need a local binding
@@ -158,7 +158,7 @@ static inline struct inet_ehash_bucket *inet_ehash_bucket(
158 struct inet_hashinfo *hashinfo, 158 struct inet_hashinfo *hashinfo,
159 unsigned int hash) 159 unsigned int hash)
160{ 160{
161 return &hashinfo->ehash[hash & (hashinfo->ehash_size - 1)]; 161 return &hashinfo->ehash[hash & hashinfo->ehash_mask];
162} 162}
163 163
164static inline spinlock_t *inet_ehash_lockp( 164static inline spinlock_t *inet_ehash_lockp(
@@ -241,7 +241,7 @@ static inline int inet_lhashfn(struct net *net, const unsigned short num)
241 241
242static inline int inet_sk_listen_hashfn(const struct sock *sk) 242static inline int inet_sk_listen_hashfn(const struct sock *sk)
243{ 243{
244 return inet_lhashfn(sock_net(sk), inet_sk(sk)->num); 244 return inet_lhashfn(sock_net(sk), inet_sk(sk)->inet_num);
245} 245}
246 246
247/* Caller must disable local BH processing. */ 247/* Caller must disable local BH processing. */
@@ -301,8 +301,8 @@ typedef __u64 __bitwise __addrpair;
301#endif /* __BIG_ENDIAN */ 301#endif /* __BIG_ENDIAN */
302#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ 302#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\
303 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 303 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \
304 ((*((__addrpair *)&(inet_sk(__sk)->daddr))) == (__cookie)) && \ 304 ((*((__addrpair *)&(inet_sk(__sk)->inet_daddr))) == (__cookie)) && \
305 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ 305 ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \
306 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 306 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
307#define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ 307#define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\
308 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 308 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \
@@ -313,9 +313,9 @@ typedef __u64 __bitwise __addrpair;
313#define INET_ADDR_COOKIE(__name, __saddr, __daddr) 313#define INET_ADDR_COOKIE(__name, __saddr, __daddr)
314#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ 314#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \
315 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 315 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \
316 (inet_sk(__sk)->daddr == (__saddr)) && \ 316 (inet_sk(__sk)->inet_daddr == (__saddr)) && \
317 (inet_sk(__sk)->rcv_saddr == (__daddr)) && \ 317 (inet_sk(__sk)->inet_rcv_saddr == (__daddr)) && \
318 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ 318 ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \
319 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 319 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
320#define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ 320#define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \
321 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 321 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \