diff options
author | Ian Gudger <igudger@google.com> | 2019-10-07 19:28:26 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-10-07 19:29:51 -0700 |
commit | 7c1587e3401a010d1865df61dbaf117c77dd062e (patch) | |
tree | 53392ccc3fc1d4cfa967f0d7f72e5920ed18fa5d /pkg/tcpip/tcpip.go | |
parent | 1de0cf3563502c1460964fc2fc9dca1ee447449a (diff) |
Implement IP_TTL.
Also change the default TTL to 64 to match Linux.
PiperOrigin-RevId: 273430341
Diffstat (limited to 'pkg/tcpip/tcpip.go')
-rw-r--r-- | pkg/tcpip/tcpip.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/tcpip/tcpip.go b/pkg/tcpip/tcpip.go index 70e7575f5..a35d6562e 100644 --- a/pkg/tcpip/tcpip.go +++ b/pkg/tcpip/tcpip.go @@ -553,6 +553,12 @@ type ModerateReceiveBufferOption bool // Maximum Segment Size(MSS) value as specified using the TCP_MAXSEG option. type MaxSegOption int +// TTLOption is used by SetSockOpt/GetSockOpt to control the default TTL/hop +// limit value for unicast messages. The default is protocol specific. +// +// A zero value indicates the default. +type TTLOption uint8 + // MulticastTTLOption is used by SetSockOpt/GetSockOpt to control the default // TTL value for multicast messages. The default is 1. type MulticastTTLOption uint8 @@ -594,6 +600,10 @@ type OutOfBandInlineOption int // datagram sockets are allowed to send packets to a broadcast address. type BroadcastOption int +// DefaultTTLOption is used by stack.(*Stack).NetworkProtocolOption to specify +// a default TTL. +type DefaultTTLOption uint8 + // Route is a row in the routing table. It specifies through which NIC (and // gateway) sets of packets should be routed. A row is considered viable if the // masked target address matches the destination address in the row. |