Module Name: src Committed By: ozaki-r Date: Wed Nov 30 06:02:37 UTC 2022
Modified Files: src/sys/net: bpf.c Log Message: bpf: support sending packets on loopback interfaces Previously sending packets on a loopback interface via bpf failed because the packets are treated as AF_UNSPEC by bpf and the loopback interface couldn't handle such packets. This fix enables user programs to prepend a protocol family (AF_INET or AF_INET6) to a payload. bpf interprets it and treats a packet as so, not just AF_UNSPEC. The protocol family is encoded as 4 bytes, host byte order as per DLT_NULL in the specification(*). (*) https://www.tcpdump.org/linktypes.html Proposed on tech-net and tech-kern To generate a diff of this commit: cvs rdiff -u -r1.248 -r1.249 src/sys/net/bpf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.