Reputation: 183
Go has built-in ICMP implementation that available on golang.org/x/net/icmp, is there any way to set TTL in this library ?, thankyou
Upvotes: 2
Views: 485
Reputation: 183
I found the answer from mattn code :
c.IPv4PacketConn().SetTTL(64) // for ipv4
c.IPv6PacketConn().HopLimit(64) // for ipv6
https://gist.github.com/mattn/7ff153fe8491a2900e83#file-ping_test-go-L24-L28
Upvotes: 3