diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-03-17 20:03:12 +0100 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-03-17 20:06:04 +0100 |
commit | a076433fcb984031fcdc7e00cf1af20a961ce478 (patch) | |
tree | 37d272c9542e33d3065c8836b41528d3332e131e /pkg/tcpip/stack | |
parent | 7d8e321a65ee1dc2659b41ad13370f5a530c498e (diff) |
WIP Dont fragment
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 |