diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-07-27 22:24:51 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-07-27 22:24:51 +0000 |
commit | 026946a2573a79232ec6e9671987dc0ba393b87f (patch) | |
tree | a53fd81f8174ec82ee460e10c98aa4a766529798 /pkg/tcpip/network/arp | |
parent | cd14778242fc68120667987b9dfebcd6f3ea0245 (diff) | |
parent | 8dbf428a1236f5962077e2506bef365362b953d0 (diff) |
Merge release-20200622.1-240-g8dbf428a1 (automated)
Diffstat (limited to 'pkg/tcpip/network/arp')
-rw-r--r-- | pkg/tcpip/network/arp/arp.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/tcpip/network/arp/arp.go b/pkg/tcpip/network/arp/arp.go index b0f57040c..31a242482 100644 --- a/pkg/tcpip/network/arp/arp.go +++ b/pkg/tcpip/network/arp/arp.go @@ -160,9 +160,12 @@ func (*protocol) LinkAddressProtocol() tcpip.NetworkProtocolNumber { } // LinkAddressRequest implements stack.LinkAddressResolver.LinkAddressRequest. -func (*protocol) LinkAddressRequest(addr, localAddr tcpip.Address, linkEP stack.LinkEndpoint) *tcpip.Error { +func (*protocol) LinkAddressRequest(addr, localAddr tcpip.Address, remoteLinkAddr tcpip.LinkAddress, linkEP stack.LinkEndpoint) *tcpip.Error { r := &stack.Route{ - RemoteLinkAddress: header.EthernetBroadcastAddress, + RemoteLinkAddress: remoteLinkAddr, + } + if len(r.RemoteLinkAddress) == 0 { + r.RemoteLinkAddress = header.EthernetBroadcastAddress } hdr := buffer.NewPrependable(int(linkEP.MaxHeaderLength()) + header.ARPSize) |