`network-monitor`: Error recognizing UDP connections with kernel 5.5
Closed this issue · 0 comments
MatteoNardi commented
Running the test suite on a qemu x86_64 machine with kernel 5.5 results in this error:
---- network-monitor::udp_ipv6_sendmsg_recvmsg ----
* 5 events generated:
| BpfEvent { timestamp: 479632540398, pid: Pid(111), payload: Bind { addr: V6(SockaddrIn6(sockaddr_in6 { sin6_family: 10, sin6_port: 38470, sin6_flowinfo: 0, sin6_addr: in6_addr { s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] }, sin6_scope_id: 0 })), proto: TCP }, buffer: b"" }
| BpfEvent { timestamp: 479633615483, pid: Pid(111), payload: Bind { addr: V6(SockaddrIn6(sockaddr_in6 { sin6_family: 10, sin6_port: 38726, sin6_flowinfo: 0, sin6_addr: in6_addr { s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] }, sin6_scope_id: 0 })), proto: TCP }, buffer: b"" }
| BpfEvent { timestamp: 479633763787, pid: Pid(111), payload: Connect { dst: V6(SockaddrIn6(sockaddr_in6 { sin6_family: 10, sin6_port: 38470, sin6_flowinfo: 0, sin6_addr: in6_addr { s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] }, sin6_scope_id: 0 })), proto: TCP }, buffer: b"" }
| BpfEvent { timestamp: 479634004683, pid: Pid(111), payload: Send { src: V6(SockaddrIn6(sockaddr_in6 { sin6_family: 10, sin6_port: 38726, sin6_flowinfo: 0, sin6_addr: in6_addr { s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] }, sin6_scope_id: 0 })), dst: V6(SockaddrIn6(sockaddr_in6 { sin6_family: 10, sin6_port: 38470, sin6_flowinfo: 0, sin6_addr: in6_addr { s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] }, sin6_scope_id: 0 })), data: BufferIndex { start: 0, len: 0, _data: PhantomData<[u8]> }, data_len: 10, proto: TCP }, buffer: b"" }
| BpfEvent { timestamp: 479636277413, pid: Pid(111), payload: Receive { src: V6(SockaddrIn6(sockaddr_in6 { sin6_family: 10, sin6_port: 38470, sin6_flowinfo: 0, sin6_addr: in6_addr { s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] }, sin6_scope_id: 0 })), dst: V6(SockaddrIn6(sockaddr_in6 { sin6_family: 10, sin6_port: 0, sin6_flowinfo: 0, sin6_addr: in6_addr { s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }, sin6_scope_id: 0 })), data: BufferIndex { start: 0, len: 0, _data: PhantomData<[u8]> }, data_len: 10, proto: TCP }, buffer: b"" }
* Only (6/8) matches for "BpfEvent { timestamp: 479634004683, pid: Pid(111), payload: Send { src: V6(SockaddrIn6(sockaddr_in6 { sin6_family: 10, sin6_port: 38726, sin6_flowinfo: 0, sin6_addr: in6_addr { s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] }, sin6_scope_id: 0 })), dst: V6(SockaddrIn6(sockaddr_in6 { sin6_family: 10, sin6_port: 38470, sin6_flowinfo: 0, sin6_addr: in6_addr { s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] }, sin6_scope_id: 0 })), data: BufferIndex { start: 0, len: 0, _data: PhantomData<[u8]> }, data_len: 10, proto: TCP }, buffer: b"" }"
✓ event type: NetworkEvent :: Send
✓ destination address: V6(SockaddrIn6(sockaddr_in6 { sin6_family: 10, sin6_port: 38470, sin6_flowinfo: 0, sin6_addr: in6_addr { s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] }, sin6_scope_id: 0 }))
✓ source address: V6(SockaddrIn6(sockaddr_in6 { sin6_family: 10, sin6_port: 38726, sin6_flowinfo: 0, sin6_addr: in6_addr { s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] }, sin6_scope_id: 0 }))
❌ data copy: (FAIL)
| found: Ok([])
| expected: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
✓ real message len: 10
❌ protocol: (FAIL)
| found: TCP
| expected: UDP
✓ pid: 111
✓ timestamp: 479632274527 - 479636615310
failures:
feature_autodetect::lsm
network-monitor::bind_udp
network-monitor::connect_udp
network-monitor::udp_ipv4_sendmsg_recvmsg
network-monitor::udp_ipv6_sendmsg_recvmsg
test result: FAILED. 29 passed; 5 failed; 0 ignored; 0 measured; 0 filtered out; finished in 62.15s
It seems we're mistaking UDP connections for TCP, which is causing all these tests to fail. Further investigation is needed.