diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-09-15 18:56:16 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-09-15 18:56:16 +0000 |
commit | f19f2d16c58ef3a3e20344dfb366971724a81eab (patch) | |
tree | 90d153a5fc2ac95fa5a083a54896d2ba4f9bf7ad /pkg/tcpip/stack/stack.go | |
parent | 96ed05d6d25e612012cd19db2316652a1f639f49 (diff) | |
parent | d3880b76cbeaa1cadc38388d5684e00172566376 (diff) |
Merge release-20200907.0-44-gd3880b76c (automated)
Diffstat (limited to 'pkg/tcpip/stack/stack.go')
-rw-r--r-- | pkg/tcpip/stack/stack.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/pkg/tcpip/stack/stack.go b/pkg/tcpip/stack/stack.go index def8b0b43..6a683545d 100644 --- a/pkg/tcpip/stack/stack.go +++ b/pkg/tcpip/stack/stack.go @@ -1311,13 +1311,11 @@ func (s *Stack) FindRoute(id tcpip.NICID, localAddr, remoteAddr tcpip.Address, n } r := makeRoute(netProto, ref.address(), remoteAddr, nic.linkEP.LinkAddress(), ref, s.handleLocal && !nic.isLoopback(), multicastLoop && !nic.isLoopback()) - r.directedBroadcast = route.Destination.IsBroadcast(remoteAddr) - if len(route.Gateway) > 0 { if needRoute { r.NextHop = route.Gateway } - } else if r.directedBroadcast { + } else if subnet := ref.addrWithPrefix().Subnet(); subnet.IsBroadcast(remoteAddr) { r.RemoteLinkAddress = header.EthernetBroadcastAddress } |