mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
net/ping: fix ICMP echo code field to 0
The code was trying to pass the ICMP protocol number here (1), which is not a valid code. Many servers will not respond to echo messages with codes other than 0. https://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml#icmp-parameters-codes-8 Updates #9299 Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:
parent
f6845b10f6
commit
8ab46952d4
@ -303,7 +303,7 @@ func (p *Pinger) Send(ctx context.Context, dest net.Addr, data []byte) (time.Dur
|
|||||||
|
|
||||||
m := icmp.Message{
|
m := icmp.Message{
|
||||||
Type: icmpType,
|
Type: icmpType,
|
||||||
Code: icmpType.Protocol(),
|
Code: 0,
|
||||||
Body: &icmp.Echo{
|
Body: &icmp.Echo{
|
||||||
ID: int(p.id),
|
ID: int(p.id),
|
||||||
Seq: int(seq),
|
Seq: int(seq),
|
||||||
|
Loading…
Reference in New Issue
Block a user