diff options
Diffstat (limited to 'include/net/inet_hashtables.h')
-rw-r--r-- | include/net/inet_hashtables.h | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 54be0287eb98..67a8fa098e3a 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -277,7 +277,6 @@ static inline struct sock *inet_lookup_listener(struct net *net, | |||
277 | On 64bit targets we combine comparisons with pair of adjacent __be32 | 277 | On 64bit targets we combine comparisons with pair of adjacent __be32 |
278 | fields in the same way. | 278 | fields in the same way. |
279 | */ | 279 | */ |
280 | typedef __u32 __bitwise __portpair; | ||
281 | #ifdef __BIG_ENDIAN | 280 | #ifdef __BIG_ENDIAN |
282 | #define INET_COMBINED_PORTS(__sport, __dport) \ | 281 | #define INET_COMBINED_PORTS(__sport, __dport) \ |
283 | ((__force __portpair)(((__force __u32)(__be16)(__sport) << 16) | (__u32)(__dport))) | 282 | ((__force __portpair)(((__force __u32)(__be16)(__sport) << 16) | (__u32)(__dport))) |
@@ -287,7 +286,6 @@ typedef __u32 __bitwise __portpair; | |||
287 | #endif | 286 | #endif |
288 | 287 | ||
289 | #if (BITS_PER_LONG == 64) | 288 | #if (BITS_PER_LONG == 64) |
290 | typedef __u64 __bitwise __addrpair; | ||
291 | #ifdef __BIG_ENDIAN | 289 | #ifdef __BIG_ENDIAN |
292 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ | 290 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ |
293 | const __addrpair __name = (__force __addrpair) ( \ | 291 | const __addrpair __name = (__force __addrpair) ( \ |
@@ -299,30 +297,34 @@ typedef __u64 __bitwise __addrpair; | |||
299 | (((__force __u64)(__be32)(__daddr)) << 32) | \ | 297 | (((__force __u64)(__be32)(__daddr)) << 32) | \ |
300 | ((__force __u64)(__be32)(__saddr))); | 298 | ((__force __u64)(__be32)(__saddr))); |
301 | #endif /* __BIG_ENDIAN */ | 299 | #endif /* __BIG_ENDIAN */ |
302 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ | 300 | #define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \ |
303 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 301 | ((inet_sk(__sk)->inet_portpair == (__ports)) && \ |
304 | ((*((__addrpair *)&(inet_sk(__sk)->inet_daddr))) == (__cookie)) && \ | 302 | (inet_sk(__sk)->inet_addrpair == (__cookie)) && \ |
305 | ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ | 303 | (!(__sk)->sk_bound_dev_if || \ |
306 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 304 | ((__sk)->sk_bound_dev_if == (__dif))) && \ |
307 | #define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ | 305 | net_eq(sock_net(__sk), (__net))) |
308 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 306 | #define INET_TW_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif)\ |
309 | ((*((__addrpair *)&(inet_twsk(__sk)->tw_daddr))) == (__cookie)) && \ | 307 | ((inet_twsk(__sk)->tw_portpair == (__ports)) && \ |
310 | ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ | 308 | (inet_twsk(__sk)->tw_addrpair == (__cookie)) && \ |
311 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 309 | (!(__sk)->sk_bound_dev_if || \ |
310 | ((__sk)->sk_bound_dev_if == (__dif))) && \ | ||
311 | net_eq(sock_net(__sk), (__net))) | ||
312 | #else /* 32-bit arch */ | 312 | #else /* 32-bit arch */ |
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, __cookie, __saddr, __daddr, __ports, __dif) \ |
315 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 315 | ((inet_sk(__sk)->inet_portpair == (__ports)) && \ |
316 | (inet_sk(__sk)->inet_daddr == (__saddr)) && \ | 316 | (inet_sk(__sk)->inet_daddr == (__saddr)) && \ |
317 | (inet_sk(__sk)->inet_rcv_saddr == (__daddr)) && \ | 317 | (inet_sk(__sk)->inet_rcv_saddr == (__daddr)) && \ |
318 | ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ | 318 | (!(__sk)->sk_bound_dev_if || \ |
319 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 319 | ((__sk)->sk_bound_dev_if == (__dif))) && \ |
320 | #define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ | 320 | net_eq(sock_net(__sk), (__net))) |
321 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 321 | #define INET_TW_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \ |
322 | (inet_twsk(__sk)->tw_daddr == (__saddr)) && \ | 322 | ((inet_twsk(__sk)->tw_portpair == (__ports)) && \ |
323 | (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \ | 323 | (inet_twsk(__sk)->tw_daddr == (__saddr)) && \ |
324 | ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ | 324 | (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \ |
325 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 325 | (!(__sk)->sk_bound_dev_if || \ |
326 | ((__sk)->sk_bound_dev_if == (__dif))) && \ | ||
327 | net_eq(sock_net(__sk), (__net))) | ||
326 | #endif /* 64-bit arch */ | 328 | #endif /* 64-bit arch */ |
327 | 329 | ||
328 | /* | 330 | /* |