Skip to content

Commit fbed24b

Browse files
Josef Bacikdavem330
authored andcommitted
inet: fix improper empty comparison
When doing my reuseport rework I screwed up and changed a if (hlist_empty(&tb->owners)) to if (!hlist_empty(&tb->owners)) This is obviously bad as all of the reuseport/reuse logic was reversed, which caused weird problems like allowing an ipv4 bind conflict if we opened an ipv4 only socket on a port followed by an ipv6 only socket on the same port. Fixes: b9470c2 ("inet: kill smallest_size and smallest_port") Reported-by: Cole Robinson <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7a56673 commit fbed24b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/inet_connection_sock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum)
321321
goto fail_unlock;
322322
}
323323
success:
324-
if (!hlist_empty(&tb->owners)) {
324+
if (hlist_empty(&tb->owners)) {
325325
tb->fastreuse = reuse;
326326
if (sk->sk_reuseport) {
327327
tb->fastreuseport = FASTREUSEPORT_ANY;

0 commit comments

Comments
 (0)