diff options
author | Bhasker Hariharan <bhaskerh@google.com> | 2018-09-04 14:30:15 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-09-04 14:31:52 -0700 |
commit | 2cff07381a911ad52cf9df70d702f39217e9539e (patch) | |
tree | 6ae3c3dd38e3c14302e0d053faf2b0106d66c467 /pkg/tcpip/network/ipv4 | |
parent | 9ae4e28f75979905a6396962a232e217323499f9 (diff) |
Automated rollback of changelist 211156845
PiperOrigin-RevId: 211525182
Change-Id: I462c20328955c77ecc7bfd8ee803ac91f15858e6
Diffstat (limited to 'pkg/tcpip/network/ipv4')
-rw-r--r-- | pkg/tcpip/network/ipv4/ipv4.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/tcpip/network/ipv4/ipv4.go b/pkg/tcpip/network/ipv4/ipv4.go index e6b1f5128..143d8e73e 100644 --- a/pkg/tcpip/network/ipv4/ipv4.go +++ b/pkg/tcpip/network/ipv4/ipv4.go @@ -44,6 +44,10 @@ const ( // buckets is the number of identifier buckets. buckets = 2048 + + // defaultIPv4TTL is the defautl TTL for IPv4 Packets egressed by + // Netstack. + defaultIPv4TTL = 255 ) type address [header.IPv4AddressSize]byte @@ -67,7 +71,7 @@ func newEndpoint(nicid tcpip.NICID, addr tcpip.Address, dispatcher stack.Transpo fragmentation: fragmentation.NewFragmentation(fragmentation.HighFragThreshold, fragmentation.LowFragThreshold, fragmentation.DefaultReassembleTimeout), } copy(e.address[:], addr) - e.id = stack.NetworkEndpointID{tcpip.Address(e.address[:])} + e.id = stack.NetworkEndpointID{LocalAddress: tcpip.Address(e.address[:])} go e.echoReplier() @@ -115,7 +119,7 @@ func (e *endpoint) WritePacket(r *stack.Route, hdr *buffer.Prependable, payload IHL: header.IPv4MinimumSize, TotalLength: length, ID: uint16(id), - TTL: 65, + TTL: defaultIPv4TTL, Protocol: uint8(protocol), SrcAddr: tcpip.Address(e.address[:]), DstAddr: r.RemoteAddress, |