diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-10-08 02:32:46 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-10-08 02:32:46 +0000 |
commit | 01a260f800c6748f75114c408b379c4b1d0553a6 (patch) | |
tree | ffe32929103dc3a8a1c4cc066ce133ddd79485dc /pkg/tcpip/stack/route.go | |
parent | a91b819e136c187caf4004d3dc8002ccb2ed51e7 (diff) | |
parent | 7c1587e3401a010d1865df61dbaf117c77dd062e (diff) |
Merge release-20190806.1-247-g7c1587e (automated)
Diffstat (limited to 'pkg/tcpip/stack/route.go')
-rw-r--r-- | pkg/tcpip/stack/route.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/tcpip/stack/route.go b/pkg/tcpip/stack/route.go index 0b09e6517..22db619a1 100644 --- a/pkg/tcpip/stack/route.go +++ b/pkg/tcpip/stack/route.go @@ -154,11 +154,15 @@ func (r *Route) IsResolutionRequired() bool { } // WritePacket writes the packet through the given route. -func (r *Route) WritePacket(gso *GSO, hdr buffer.Prependable, payload buffer.VectorisedView, protocol tcpip.TransportProtocolNumber, ttl uint8) *tcpip.Error { +func (r *Route) WritePacket(gso *GSO, hdr buffer.Prependable, payload buffer.VectorisedView, protocol tcpip.TransportProtocolNumber, ttl uint8, useDefaultTTL bool) *tcpip.Error { if !r.ref.isValidForOutgoing() { return tcpip.ErrInvalidEndpointState } + if useDefaultTTL { + ttl = r.DefaultTTL() + } + err := r.ref.ep.WritePacket(r, gso, hdr, payload, protocol, ttl, r.loop) if err != nil { r.Stats().IP.OutgoingPacketErrors.Increment() |