aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@google.com>2015-07-09 17:17:57 -0700
committerZiyan <jaraidaniel@gmail.com>2016-10-29 01:34:19 +0200
commit388ebaeb91e8f7c4c1b1f9939924e310fae47bf0 (patch)
treefcaddedbcbe75eadbbbc2549a142404652f21099
parentcbf8bf03ed041a2be4c03859c70899cb7cbadf36 (diff)
downloadkernel_samsung_tuna-388ebaeb91e8f7c4c1b1f9939924e310fae47bf0.tar.gz
kernel_samsung_tuna-388ebaeb91e8f7c4c1b1f9939924e310fae47bf0.tar.bz2
kernel_samsung_tuna-388ebaeb91e8f7c4c1b1f9939924e310fae47bf0.zip
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 4349e468fd1..bf1adbb405f 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3379,7 +3379,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);