V3.2
This commit is contained in:
parent
3a8850b8c2
commit
c89cea01a6
BIN
dist/livetrace-linux-amd64
vendored
BIN
dist/livetrace-linux-amd64
vendored
Binary file not shown.
BIN
dist/livetrace-windows-amd64.exe
vendored
BIN
dist/livetrace-windows-amd64.exe
vendored
Binary file not shown.
17
src/main.go
17
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")
|
||||
|
||||
@ -13,3 +13,5 @@ func winAPIProbe(_ net.IP, _ int, _ time.Duration, _ []byte) (float64, string, u
|
||||
}
|
||||
|
||||
func (t *Tracer) sendProbeWinAPI(_ int) {}
|
||||
|
||||
func udpModeWarning() {}
|
||||
|
||||
@ -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 <ipexport.h>
|
||||
type ipOptInfo struct {
|
||||
Ttl uint8
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user