diff options
author | Fabricio Voznika <fvoznika@google.com> | 2018-08-08 22:02:09 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-08-08 22:03:35 -0700 |
commit | ea1e39a314d3a248d8b682a9f63e686530597d61 (patch) | |
tree | 160e0fd447cb80d06324311ebb4d14f2e5f64824 /pkg/tcpip/stack/nic.go | |
parent | dbbe9ec91541dba387f8044cbf73fd29f604f902 (diff) |
Resend packets back to netstack if destined to itself
Add option to redirect packet back to netstack if it's destined to itself.
This fixes the problem where connecting to the local NIC address would
not work, e.g.:
echo bar | nc -l -p 8080 &
echo foo | nc 192.168.0.2 8080
PiperOrigin-RevId: 207995083
Change-Id: I17adc2a04df48bfea711011a5df206326a1fb8ef
Diffstat (limited to 'pkg/tcpip/stack/nic.go')
-rw-r--r-- | pkg/tcpip/stack/nic.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/tcpip/stack/nic.go b/pkg/tcpip/stack/nic.go index 25c06cba5..c1480f97b 100644 --- a/pkg/tcpip/stack/nic.go +++ b/pkg/tcpip/stack/nic.go @@ -327,8 +327,7 @@ func (n *NIC) DeliverNetworkPacket(linkEP LinkEndpoint, remoteLinkAddr tcpip.Lin return } - r := makeRoute(protocol, dst, src, ref) - r.LocalLinkAddress = linkEP.LinkAddress() + r := makeRoute(protocol, dst, src, linkEP.LinkAddress(), ref) r.RemoteLinkAddress = remoteLinkAddr ref.ep.HandlePacket(&r, vv) ref.decRef() |