diff options
Diffstat (limited to 'pkg/tcpip/stack')
-rw-r--r-- | pkg/tcpip/stack/nic.go | 9 | ||||
-rw-r--r-- | pkg/tcpip/stack/registration.go | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/pkg/tcpip/stack/nic.go b/pkg/tcpip/stack/nic.go index af211f953..133e6e76b 100644 --- a/pkg/tcpip/stack/nic.go +++ b/pkg/tcpip/stack/nic.go @@ -1312,7 +1312,14 @@ func (n *NIC) forwardPacket(r *Route, protocol tcpip.NetworkProtocolNumber, pkt } } - if err := n.linkEP.WritePacket(r, nil /* gso */, protocol, pkt); err != nil { +// if err := n.linkEP.WritePacket(r, nil /* gso */, protocol, pkt); err != nil { + params := NetworkHeaderParams{ + Protocol: header.ICMPv4ProtocolNumber, //FIXME + TTL: 64, //FIXME + TOS: DefaultTOS, //FIXME + Forwarded: true, + } + if err := r.WritePacket(nil /* gso */, params, pkt); err != nil { r.Stats().IP.OutgoingPacketErrors.Increment() return } diff --git a/pkg/tcpip/stack/registration.go b/pkg/tcpip/stack/registration.go index 1231dee63..5424f414c 100644 --- a/pkg/tcpip/stack/registration.go +++ b/pkg/tcpip/stack/registration.go @@ -215,6 +215,8 @@ type NetworkHeaderParams struct { // TOS refers to TypeOfService or TrafficClass field of the IP-header. TOS uint8 + + Forwarded bool } // NetworkEndpoint is the interface that needs to be implemented by endpoints |