mirror of
https://github.com/torvalds/linux.git
synced 2024-11-02 18:21:49 +00:00
tcp: bind() fix autoselection to share ports
The current code checks for conflicts when the application requests a specific port. If there is no conflict, then the request is granted. On the other hand, the port autoselection done by the kernel fails when all ports are bound even when there is a port with no conflict available. The fix changes port autoselection to check if there is a conflict and use it if not. Signed-off-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
68315801db
commit
2b05ad33e1
@ -128,6 +128,11 @@ again:
|
||||
goto have_snum;
|
||||
}
|
||||
}
|
||||
if (!inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb)) {
|
||||
spin_unlock(&head->lock);
|
||||
snum = rover;
|
||||
goto have_snum;
|
||||
}
|
||||
goto next;
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user