diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/inet_hashtables.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 34cc76e3ddb4..d27ee8c0da3f 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -34,12 +34,13 @@ | |||
34 | #include <asm/byteorder.h> | 34 | #include <asm/byteorder.h> |
35 | 35 | ||
36 | /* This is for all connections with a full identity, no wildcards. | 36 | /* This is for all connections with a full identity, no wildcards. |
37 | * New scheme, half the table is for TIME_WAIT, the other half is | 37 | * One chain is dedicated to TIME_WAIT sockets. |
38 | * for the rest. I'll experiment with dynamic table growth later. | 38 | * I'll experiment with dynamic table growth later. |
39 | */ | 39 | */ |
40 | struct inet_ehash_bucket { | 40 | struct inet_ehash_bucket { |
41 | rwlock_t lock; | 41 | rwlock_t lock; |
42 | struct hlist_head chain; | 42 | struct hlist_head chain; |
43 | struct hlist_head twchain; | ||
43 | }; | 44 | }; |
44 | 45 | ||
45 | /* There are a few simple rules, which allow for local port reuse by | 46 | /* There are a few simple rules, which allow for local port reuse by |
@@ -97,8 +98,7 @@ struct inet_hashinfo { | |||
97 | * | 98 | * |
98 | * TCP_ESTABLISHED <= sk->sk_state < TCP_CLOSE | 99 | * TCP_ESTABLISHED <= sk->sk_state < TCP_CLOSE |
99 | * | 100 | * |
100 | * First half of the table is for sockets not in TIME_WAIT, second half | 101 | * TIME_WAIT sockets use a separate chain (twchain). |
101 | * is for TIME_WAIT sockets only. | ||
102 | */ | 102 | */ |
103 | struct inet_ehash_bucket *ehash; | 103 | struct inet_ehash_bucket *ehash; |
104 | 104 | ||
@@ -369,7 +369,7 @@ static inline struct sock * | |||
369 | } | 369 | } |
370 | 370 | ||
371 | /* Must check for a TIME_WAIT'er before going to listener hash. */ | 371 | /* Must check for a TIME_WAIT'er before going to listener hash. */ |
372 | sk_for_each(sk, node, &(head + hashinfo->ehash_size)->chain) { | 372 | sk_for_each(sk, node, &head->twchain) { |
373 | if (INET_TW_MATCH(sk, hash, acookie, saddr, daddr, ports, dif)) | 373 | if (INET_TW_MATCH(sk, hash, acookie, saddr, daddr, ports, dif)) |
374 | goto hit; | 374 | goto hit; |
375 | } | 375 | } |