diff --git a/dist/livetrace-linux-amd64 b/dist/livetrace-linux-amd64 index 580fc5e..cbb4f31 100755 Binary files a/dist/livetrace-linux-amd64 and b/dist/livetrace-linux-amd64 differ diff --git a/dist/livetrace-windows-amd64.exe b/dist/livetrace-windows-amd64.exe index c0add3d..4a134ab 100755 Binary files a/dist/livetrace-windows-amd64.exe and b/dist/livetrace-windows-amd64.exe differ diff --git a/src/main.go b/src/main.go index 2d22d59..30a76c8 100644 --- a/src/main.go +++ b/src/main.go @@ -295,14 +295,17 @@ func NewTracer( func (t *Tracer) Done() <-chan struct{} { return t.stopCh } func (t *Tracer) Start() error { - if t.proto == "winapi" { - // Windows ICMP API manages its own sockets per probe. - // No raw socket, no receive loop, no cleanup loop needed. - go t.probeLoop() - return nil - } + if t.proto == "winapi" { + go t.probeLoop() + return nil + } - var err error + // ADD THIS: + if t.proto == "udp" { + udpModeWarning() + } + + var err error t.icmpConn, err = icmp.ListenPacket("ip4:icmp", "0.0.0.0") if err != nil { t.icmpConn, err = icmp.ListenPacket("udp4", "0.0.0.0:0") diff --git a/src/winapi_other.go b/src/winapi_other.go index 0f7cb19..eeed34e 100644 --- a/src/winapi_other.go +++ b/src/winapi_other.go @@ -13,3 +13,5 @@ func winAPIProbe(_ net.IP, _ int, _ time.Duration, _ []byte) (float64, string, u } func (t *Tracer) sendProbeWinAPI(_ int) {} + +func udpModeWarning() {} diff --git a/src/winapi_windows.go b/src/winapi_windows.go index d9d95ed..c93da0b 100644 --- a/src/winapi_windows.go +++ b/src/winapi_windows.go @@ -8,6 +8,7 @@ import ( "syscall" "time" "unsafe" + "os" ) var ( @@ -23,6 +24,12 @@ const ( ipReqTimedOut uint32 = 11010 ) +func udpModeWarning() { + fmt.Fprintln(os.Stderr, + "Warning: UDP mode on Windows requires an inbound Windows Firewall rule "+ + "to allow ICMP Time Exceeded (Type 11). Consider using -proto winapi instead.") +} + // mirrors IP_OPTION_INFORMATION from type ipOptInfo struct { Ttl uint8