diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-03-16 17:34:27 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-03-16 17:34:27 +0000 |
commit | 8663fa59e76a84e284b4e726a487f4920c5b4a76 (patch) | |
tree | aca473b6adf0d1d3bb8f328a00437e453cd21254 /pkg/tcpip/network/ipv6 | |
parent | 34cc37e563c44dc9c16322a8640f944597648a84 (diff) | |
parent | ebd7c1b889e5d212f4a694d3addbada241936e8e (diff) |
Merge release-20210309.0-31-gebd7c1b88 (automated)
Diffstat (limited to 'pkg/tcpip/network/ipv6')
-rw-r--r-- | pkg/tcpip/network/ipv6/icmp.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/tcpip/network/ipv6/icmp.go b/pkg/tcpip/network/ipv6/icmp.go index 6344a3e09..8059e0690 100644 --- a/pkg/tcpip/network/ipv6/icmp.go +++ b/pkg/tcpip/network/ipv6/icmp.go @@ -899,13 +899,16 @@ func (e *endpoint) LinkAddressRequest(targetAddr, localAddr tcpip.Address, remot } if len(localAddr) == 0 { + // Find an address that we can use as our source address. addressEndpoint := e.AcquireOutgoingPrimaryAddress(remoteAddr, false /* allowExpired */) if addressEndpoint == nil { return &tcpip.ErrNetworkUnreachable{} } localAddr = addressEndpoint.AddressWithPrefix().Address - } else if e.protocol.stack.CheckLocalAddress(e.nic.ID(), ProtocolNumber, localAddr) == 0 { + addressEndpoint.DecRef() + } else if !e.checkLocalAddress(localAddr) { + // The provided local address is not assigned to us. return &tcpip.ErrBadLocalAddress{} } |