mirror of
https://github.com/mandiant/gopacket
synced 2026-06-21 13:57:02 +00:00
c3173c535a
Enables clean builds under GOOS=windows CGO_ENABLED=0 and under CGO_ENABLED=0 on Linux. The three tools that can't be built in those configurations now substitute a stub that prints a clear message and exits 1, so go build ./... succeeds across all target platforms. - tools/sniff: tagged !windows && cgo (needs libpcap via cgo). Stub (main_stub.go) covers windows || !cgo. - tools/split: same tags as sniff (also pcap). - tools/sniffer: tagged !windows (uses Unix raw sockets directly via syscall, not cgo). Stub (main_windows.go) covers Windows. Verified: - go build ./... clean (default, cgo=1 Linux) - CGO_ENABLED=0 go build ./... clean (portable Linux) - GOOS=windows CGO_ENABLED=0 go build ./... clean (Windows) - go vet clean across all three configurations - All 13 pkg/transport tests pass under CGO_ENABLED=0, confirming direct_portable.go's directDial path is correct.