diff options
author | aleksej <aleksej.paschenko@gmail.com> | 2019-10-27 15:14:35 +0300 |
---|---|---|
committer | aleksej <aleksej.paschenko@gmail.com> | 2019-10-27 15:28:15 +0300 |
commit | 352ae1022ce19de28fc72e034cc469872ad79d06 (patch) | |
tree | daab172474c8a917a589a2142fc66ae9cba272c3 /pkg/tcpip/network | |
parent | 1c480abc39b9957606ff8bf125a5c253ad8a76cb (diff) |
Add /proc/sys/net/ipv4/ip_forward
Diffstat (limited to 'pkg/tcpip/network')
-rw-r--r-- | pkg/tcpip/network/ipv4/ipv4.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/tcpip/network/ipv4/ipv4.go b/pkg/tcpip/network/ipv4/ipv4.go index 1339f8474..90f4406e5 100644 --- a/pkg/tcpip/network/ipv4/ipv4.go +++ b/pkg/tcpip/network/ipv4/ipv4.go @@ -307,7 +307,9 @@ func (e *endpoint) WriteHeaderIncludedPacket(r *stack.Route, payload buffer.Vect return nil } - hdr := buffer.NewPrependableFromView(payload.ToView()) + // If we want to send the packet to a link-layer, + // we have to reserve space for an Ethernet header. + hdr := buffer.NewPrependableFromView(payload.ToView(), int(e.linkEP.MaxHeaderLength())) r.Stats().IP.PacketsSent.Increment() return e.linkEP.WritePacket(r, nil /* gso */, hdr, buffer.VectorisedView{}, ProtocolNumber) } |