diff options
author | Bhasker Hariharan <bhaskerh@google.com> | 2020-07-23 12:52:18 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-07-23 12:54:12 -0700 |
commit | 20b556e625354dd8330e30e4075ad06eedc6a2ce (patch) | |
tree | fc63afad3c7465fe78be053fb1a39cf88295660d /pkg/tcpip/transport/raw | |
parent | 6f7f73996791bbab6b63c248000df0d3ce652f2b (diff) |
Fix wildcard bind for raw socket.
Fixes #3334
PiperOrigin-RevId: 322846384
Diffstat (limited to 'pkg/tcpip/transport/raw')
-rw-r--r-- | pkg/tcpip/transport/raw/endpoint.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/tcpip/transport/raw/endpoint.go b/pkg/tcpip/transport/raw/endpoint.go index c2e9fd29f..aefe0e2b2 100644 --- a/pkg/tcpip/transport/raw/endpoint.go +++ b/pkg/tcpip/transport/raw/endpoint.go @@ -456,7 +456,7 @@ func (e *endpoint) Bind(addr tcpip.FullAddress) *tcpip.Error { defer e.mu.Unlock() // If a local address was specified, verify that it's valid. - if e.stack.CheckLocalAddress(addr.NIC, e.NetProto, addr.Addr) == 0 { + if len(addr.Addr) != 0 && e.stack.CheckLocalAddress(addr.NIC, e.NetProto, addr.Addr) == 0 { return tcpip.ErrBadLocalAddress } |