Commit 8a8241cd authored by Jakub Sitnicki's avatar Jakub Sitnicki Committed by Paolo Abeni
Browse files

selftests/net: Test tcp port reuse after unbinding a socket



Exercise the scenario described in detail in the cover letter:

  1) socket A: connect() from ephemeral port X
  2) socket B: explicitly bind() to port X
  3) check that port X is now excluded from ephemeral ports
  4) close socket B to release the port bind
  5) socket C: connect() from ephemeral port X

As well as a corner case to test that the connect-bind flag is cleared:

  1) connect() from ephemeral port X
  2) disconnect the socket with connect(AF_UNSPEC)
  3) bind() it explicitly to port X
  4) check that port X is now excluded from ephemeral ports

Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
Link: https://patch.msgid.link/20250917-update-bind-bucket-state-on-unhash-v5-2-57168b661b47@cloudflare.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent d57f4b87
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment