Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9db82589 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Dmitry Shmidt
Browse files

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: default avatarDmitry Torokhov <dtor@google.com>
parent 41511869
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);