Skip to content

Commit dfa0dca

Browse files
committed
lint: netstack/icmpecho.go
1 parent fc55574 commit dfa0dca

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

intra/core/wire/parsed.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,9 @@ func (q *Parsed) IP6Header() IP6Header {
401401
func (q *Parsed) ICMPHeaderString() string {
402402
switch q.IPProto {
403403
case ICMPv4:
404-
return q.ICMP4Header().String()
404+
return q.ICMP4Header().Stringer()
405405
case ICMPv6:
406-
return q.ICMP6Header().String()
406+
return q.ICMP6Header().Stringer()
407407
}
408408
return "ICMP" + string(q.IPVersion) + "{???}"
409409
}
@@ -416,11 +416,11 @@ func (q *Parsed) ICMP4Header() ICMP4Header {
416416
}
417417
}
418418

419-
func (h ICMP4Header) String() string {
419+
func (h ICMP4Header) Stringer() string {
420420
return fmt.Sprintf("%v", h)
421421
}
422422

423-
func (h ICMP6Header) String() string {
423+
func (h ICMP6Header) Stringer() string {
424424
return fmt.Sprintf("%v", h)
425425
}
426426

intra/netstack/icmpecho.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func (r *icmpResponder) echoReply(pkt *wire.Parsed, d []byte, ok bool) ([]byte,
183183
(&icmpHdr).Type = wire.ICMP4Unreachable
184184
(&icmpHdr).Code = wire.ICMP4HostUnreachable
185185
}
186-
tag := icmpHdr.String()
186+
tag := icmpHdr.Stringer()
187187
return wire.Generate(&icmpHdr, d), header.IPv4ProtocolNumber, tag, nil
188188
case 6:
189189
icmpHdr := pkt.ICMP6Header()
@@ -192,7 +192,7 @@ func (r *icmpResponder) echoReply(pkt *wire.Parsed, d []byte, ok bool) ([]byte,
192192
(&icmpHdr).Type = wire.ICMP6Unreachable
193193
(&icmpHdr).Code = wire.ICMP6NoRoute
194194
}
195-
tag := icmpHdr.String()
195+
tag := icmpHdr.Stringer()
196196
// github.com/tailscale/tailscale/blob/7de1b0b33082cc/wgengine/userspace.go#L577
197197
return wire.Generate(&icmpHdr, d), header.IPv6ProtocolNumber, tag, nil
198198
default:

0 commit comments

Comments
 (0)