diff options
author | Bhasker Hariharan <bhaskerh@google.com> | 2021-07-01 14:39:20 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-07-01 14:42:00 -0700 |
commit | 570ca571805d6939c4c24b6a88660eefaf558ae7 (patch) | |
tree | 50b36e53b2b692a72dc135d3ec1aa3db58fb5b05 /pkg/tcpip/ports/BUILD | |
parent | 3d4a8824f8e7aafdf6c1d18822b7593fa2e3e6bb (diff) |
Fix bug with TCP bind w/ SO_REUSEADDR.
In gVisor today its possible that when trying to bind a TCP socket
w/ SO_REUSEADDR specified and requesting the kernel pick a port by
setting port to zero can result in a previously bound port being
returned. This behaviour is incorrect as the user is clearly requesting
a free port. The behaviour is fine when the user explicity specifies
a port.
This change now checks if the user specified a port when making a port
reservation for a TCP port and only returns unbound ports even if
SO_REUSEADDR was specified.
Fixes #6209
PiperOrigin-RevId: 382607638
Diffstat (limited to 'pkg/tcpip/ports/BUILD')
-rw-r--r-- | pkg/tcpip/ports/BUILD | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/tcpip/ports/BUILD b/pkg/tcpip/ports/BUILD index b7f6d52ae..fe98a52af 100644 --- a/pkg/tcpip/ports/BUILD +++ b/pkg/tcpip/ports/BUILD @@ -12,6 +12,7 @@ go_library( deps = [ "//pkg/sync", "//pkg/tcpip", + "//pkg/tcpip/header", ], ) |