diff options
author | Dmitry Torokhov <dtor@google.com> | 2015-07-09 17:17:57 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2015-09-04 14:17:14 -0700 |
commit | 9db825899c5c68b03d784efaf42620e0a12da8ee (patch) | |
tree | 2d54a20b062c639f577950adfb6b91ae65211bb1 | |
parent | 415118692305d7a98731abc8068ab59b9c798e9a (diff) |
net: fix iterating over hashtable in tcp_nuke_addr()
The actual size of the tcp hashinfo table is tcp_hashinfo.ehash_mask + 1
so we need to adjust the loop accordingly to get the sockets hashed into
the last bucket.
Change-Id: I796b3c7b4a1a7fa35fba9e5192a4a403eb6e17de
Signed-off-by: Dmitry Torokhov <dtor@google.com>
-rw-r--r-- | net/ipv4/tcp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 3ebfb9aaf188..6824a441172b 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -3181,7 +3181,7 @@ int tcp_nuke_addr(struct net *net, struct sockaddr *addr) return -EAFNOSUPPORT; } - for (bucket = 0; bucket < tcp_hashinfo.ehash_mask; bucket++) { + for (bucket = 0; bucket <= tcp_hashinfo.ehash_mask; bucket++) { struct hlist_nulls_node *node; struct sock *sk; spinlock_t *lock = inet_ehash_lockp(&tcp_hashinfo, bucket); |