diff options
author | Ian Gudger <igudger@google.com> | 2019-11-12 14:02:53 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-11-12 14:04:14 -0800 |
commit | 57a2a5ea3359e0879f5e4cc40fdb9ad973c689a8 (patch) | |
tree | e5f01633ac62e5634ed04c4f179dd7c5c581d988 /pkg/tcpip/transport | |
parent | 548d65b2b6116beecb2aa782a0b5428fb20f89a0 (diff) |
Add tests for SO_REUSEADDR and SO_REUSEPORT.
* Basic tests for the SO_REUSEADDR and SO_REUSEPORT options.
* SO_REUSEADDR functional tests for TCP and UDP.
* SO_REUSEADDR and SO_REUSEPORT interaction tests for UDP.
* Stubbed support for UDP getsockopt(SO_REUSEADDR).
PiperOrigin-RevId: 280049265
Diffstat (limited to 'pkg/tcpip/transport')
-rw-r--r-- | pkg/tcpip/transport/udp/endpoint.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/udp/endpoint.go b/pkg/tcpip/transport/udp/endpoint.go index 5270f24df..dda7af910 100644 --- a/pkg/tcpip/transport/udp/endpoint.go +++ b/pkg/tcpip/transport/udp/endpoint.go @@ -732,6 +732,10 @@ func (e *endpoint) GetSockOpt(opt interface{}) *tcpip.Error { *o = tcpip.MulticastLoopOption(v) return nil + case *tcpip.ReuseAddressOption: + *o = 0 + return nil + case *tcpip.ReusePortOption: e.mu.RLock() v := e.reusePort |