In a production setup we randomly observe this:
ts=2026-04-24T15:26:37.561+02:00 level=error msg="failed to start capture: failed to initialize capture: failed to set AF_PACKET socket options on eth0: failed to set promiscuous mode: invalid argument" version=4.2.5-ec768152 iface=eth0
Analysis shows:
- In
capture/afpacket/socket/socket.go:107, optlen is passed as uintptr(unsafe.Pointer(&reqLen)) (pointer), but setsockopt expects the length value.
- The same call uses
unix.SOL_SOCKET for PACKET_ADD_MEMBERSHIP; packet membership options are handled at SOL_PACKET.
So this line is effectively malformed in two ways. That can produce EINVAL (invalid argument).
In a production setup we randomly observe this:
Analysis shows:
capture/afpacket/socket/socket.go:107,optlenis passed asuintptr(unsafe.Pointer(&reqLen))(pointer), butsetsockoptexpects the length value.unix.SOL_SOCKETforPACKET_ADD_MEMBERSHIP; packet membership options are handled atSOL_PACKET.So this line is effectively malformed in two ways. That can produce
EINVAL(invalid argument).