Skip to content

Commit cbf8c71

Browse files
committed
TUN-6716: Document limitation of Windows ICMP proxy
1 parent 870193c commit cbf8c71

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

ingress/icmp_windows.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ func (ip *icmpProxy) Serve(ctx context.Context) error {
262262
return ctx.Err()
263263
}
264264

265+
// Request sends an ICMP echo request and wait for a reply or timeout.
266+
// The async version of Win32 APIs take a callback whose memory is not garbage collected, so we use the synchronous version.
267+
// It's possible that a slow request will block other requests, so we set the timeout to only 1s.
265268
func (ip *icmpProxy) Request(pk *packet.ICMP, responder packet.FunnelUniPipe) error {
266269
if pk == nil {
267270
return errPacketNil

packet/router.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
type ICMPRouter interface {
1212
// Serve starts listening for responses to the requests until context is done
1313
Serve(ctx context.Context) error
14-
// Request sends an ICMP message
14+
// Request sends an ICMP message. Implementations should not modify pk after the function returns.
1515
Request(pk *ICMP, responder FunnelUniPipe) error
1616
}
1717

0 commit comments

Comments
 (0)