summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/udp
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2019-11-12 14:02:53 -0800
committergVisor bot <gvisor-bot@google.com>2019-11-12 14:04:14 -0800
commit57a2a5ea3359e0879f5e4cc40fdb9ad973c689a8 (patch)
treee5f01633ac62e5634ed04c4f179dd7c5c581d988 /pkg/tcpip/transport/udp
parent548d65b2b6116beecb2aa782a0b5428fb20f89a0 (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/udp')
-rw-r--r--pkg/tcpip/transport/udp/endpoint.go4
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