diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-07-19 16:37:30 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-07-19 16:37:30 +0000 |
commit | e414d16578daf4fd6b98f4631131f1052cb99d5c (patch) | |
tree | 45db1702fff94c703d0dc8d074ca07f58912f9fd /pkg/tcpip | |
parent | 881e2e983db5d5443cf94ef90655e7f698e8961c (diff) | |
parent | 0e040ba6e87f5fdcb23854909aad39aa1883925f (diff) |
Merge 0e040ba6 (automated)
Diffstat (limited to 'pkg/tcpip')
-rw-r--r-- | pkg/tcpip/transport/udp/endpoint.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/tcpip/transport/udp/endpoint.go b/pkg/tcpip/transport/udp/endpoint.go index 70f4a2b8c..91f89a781 100644 --- a/pkg/tcpip/transport/udp/endpoint.go +++ b/pkg/tcpip/transport/udp/endpoint.go @@ -252,7 +252,7 @@ func (e *endpoint) connectRoute(nicid tcpip.NICID, addr tcpip.FullAddress) (stac if nicid == 0 { nicid = e.multicastNICID } - if localAddr == "" { + if localAddr == "" && nicid == 0 { localAddr = e.multicastAddr } } @@ -675,6 +675,9 @@ func sendUDP(r *stack.Route, data buffer.VectorisedView, localPort, remotePort u func (e *endpoint) checkV4Mapped(addr *tcpip.FullAddress, allowMismatch bool) (tcpip.NetworkProtocolNumber, *tcpip.Error) { netProto := e.netProto + if len(addr.Addr) == 0 { + return netProto, nil + } if header.IsV4MappedAddress(addr.Addr) { // Fail if using a v4 mapped address on a v6only endpoint. if e.v6only { |