fix(fake-tcp): normalize Linux packet sockets to layer 3 (#2255)
Use AF_PACKET SOCK_DGRAM so Ethernet, TUN, and point-to-point interfaces expose the same IP payload to the BPF filter. Rebuild the synthetic Ethernet envelope expected by fake TCP on receive and strip it before transmitting through the cooked socket. Bind sockets to the selected IP protocol and reject non-initial IPv4 fragments before reading TCP ports. Preserve peer MAC addresses on Ethernet links. Add privileged TUN and veth tests for IPv4/IPv6 receive, send, tuple filtering, and fragment rejection, and enable them in Linux CI. Co-authored-by: KKRainbow <443152178@qq.com> Co-authored-by: Max Sum <4883681+Max-Sum@users.noreply.github.com>
M
Max Sum committed
52bb26680a51ffafc8b560999fd99971062c19f9
Parent: 0b27ac2
Committed by GitHub <noreply@github.com>
on 8/12/2026, 12:21:42 PM