diff options
Diffstat (limited to 'include/net/inet_hashtables.h')
| -rw-r--r-- | include/net/inet_hashtables.h | 24 | 
1 files changed, 4 insertions, 20 deletions
| diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 07840baa9341..135d80fd658e 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/wait.h> | 26 | #include <linux/wait.h> | 
| 27 | 27 | ||
| 28 | #include <net/inet_connection_sock.h> | 28 | #include <net/inet_connection_sock.h> | 
| 29 | #include <net/inet_sock.h> | ||
| 29 | #include <net/route.h> | 30 | #include <net/route.h> | 
| 30 | #include <net/sock.h> | 31 | #include <net/sock.h> | 
| 31 | #include <net/tcp_states.h> | 32 | #include <net/tcp_states.h> | 
| @@ -128,26 +129,6 @@ struct inet_hashinfo { | |||
| 128 | kmem_cache_t *bind_bucket_cachep; | 129 | kmem_cache_t *bind_bucket_cachep; | 
| 129 | }; | 130 | }; | 
| 130 | 131 | ||
| 131 | static inline unsigned int inet_ehashfn(const __u32 laddr, const __u16 lport, | ||
| 132 | const __u32 faddr, const __u16 fport) | ||
| 133 | { | ||
| 134 | unsigned int h = (laddr ^ lport) ^ (faddr ^ fport); | ||
| 135 | h ^= h >> 16; | ||
| 136 | h ^= h >> 8; | ||
| 137 | return h; | ||
| 138 | } | ||
| 139 | |||
| 140 | static inline int inet_sk_ehashfn(const struct sock *sk) | ||
| 141 | { | ||
| 142 | const struct inet_sock *inet = inet_sk(sk); | ||
| 143 | const __u32 laddr = inet->rcv_saddr; | ||
| 144 | const __u16 lport = inet->num; | ||
| 145 | const __u32 faddr = inet->daddr; | ||
| 146 | const __u16 fport = inet->dport; | ||
| 147 | |||
| 148 | return inet_ehashfn(laddr, lport, faddr, fport); | ||
| 149 | } | ||
| 150 | |||
| 151 | static inline struct inet_ehash_bucket *inet_ehash_bucket( | 132 | static inline struct inet_ehash_bucket *inet_ehash_bucket( | 
| 152 | struct inet_hashinfo *hashinfo, | 133 | struct inet_hashinfo *hashinfo, | 
| 153 | unsigned int hash) | 134 | unsigned int hash) | 
| @@ -434,4 +415,7 @@ static inline struct sock *inet_lookup(struct inet_hashinfo *hashinfo, | |||
| 434 | 415 | ||
| 435 | return sk; | 416 | return sk; | 
| 436 | } | 417 | } | 
| 418 | |||
| 419 | extern int inet_hash_connect(struct inet_timewait_death_row *death_row, | ||
| 420 | struct sock *sk); | ||
| 437 | #endif /* _INET_HASHTABLES_H */ | 421 | #endif /* _INET_HASHTABLES_H */ | 
