diff options
author | Ross Hanson <ross.hanson@gmail.com> | 2019-09-12 01:25:06 -0700 |
---|---|---|
committer | Pablo Mazzini <pmazzini@gmail.com> | 2019-09-12 09:25:06 +0100 |
commit | bff32b6395da8a13cbe6e9e7e3a303515ced45b2 (patch) | |
tree | 0af82186d1d5d5c7b91abae80d4d81a9c87ddab8 /dhcpv4/nclient4/ipv4.go | |
parent | 393ae75a101b4e8d93f82dd7242401dd50ac0868 (diff) |
Increase DHCPv4 IP TTL from 30 to 64 (#314)
RFC 1700 recommends a value of 64 for the default IP time to live (TTL)
parameter. This is only necessary for the V4 client because it uses
the net.PacketConn, while the IPv6 implementation uses a net.UDPConn instead.
From https://tools.ietf.org/html/rfc1700:
IP TIME TO LIVE PARAMETER
The current recommended default time to live (TTL) for the
Internet Protocol (IP) [45,105] is 64.
Signed-off-by: Ross Hanson <rosshanson@google.com>
Diffstat (limited to 'dhcpv4/nclient4/ipv4.go')
-rw-r--r-- | dhcpv4/nclient4/ipv4.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dhcpv4/nclient4/ipv4.go b/dhcpv4/nclient4/ipv4.go index d5c30ee..5733eb4 100644 --- a/dhcpv4/nclient4/ipv4.go +++ b/dhcpv4/nclient4/ipv4.go @@ -351,7 +351,7 @@ func udp4pkt(packet []byte, dest *net.UDPAddr, src *net.UDPAddr) []byte { ipv4fields := &IPv4Fields{ IHL: IPv4MinimumSize, TotalLength: uint16(ipLen + udpLen + len(packet)), - TTL: 30, + TTL: 64, // Per RFC 1700's recommendation for IP time to live Protocol: uint8(UDPProtocolNumber), SrcAddr: src.IP.To4(), DstAddr: dest.IP.To4(), |