🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: muc.lists.freebsd.ports
1 messages
1 total messages Started by alexandr.baryshnyev Wed, 11 Nov 2026 16:23
[PATCH] net/parpd: use BIOCSDIRECTION to set inbound-only BPF capture
#161
Author: alexandr.baryshnyev
Date: Wed, 11 Nov 2026 16:23
53 lines
4999 bytes
Hello,

While configuring parpd 1.3 on FreeBSD, a likely typo was identified
in bind_interface() in bpf.c.

The function initializes direction to BPF_D_IN, but then calls
BIOCGDIRECTION. This ioctl reads the current capture direction
rather than setting it, overwriting the initialized value.

Replacing BIOCGDIRECTION with BIOCSDIRECTION sets the intended
inbound-only capture.

This matters because handle_arp_packet() does not explicitly stop
processing locally originated ARP requests after arp_learn().
If outgoing broadcast ARP requests are captured, they may reach
the proxy ARP response rules.

Proposed fix:

--- bpf.c.orig
+++ bpf.c
@@ -48 +48 @@
-   if(0 > ioctl(fd, BIOCGDIRECTION, &direction)) {
+   if(0 > ioctl(fd, BIOCSDIRECTION, &direction)) {

Attribution: the issue was identified and the patch prepared with
assistance from an AI assistant (Auto Router via OpenRouter).
I applied the patch, built the program, and performed the deployment
and connectivity tests described below. I am submitting it for human
review, not claiming independent authorship of the analysis.

Test environment:
- FreeBSD 12.4-RELEASE-p9 amd64;
- parpd 1.3, built with base clang 13;
- 11 separate instances on VLAN interfaces;
- static-MAC proxy ARP rules pointing clients to the central router.

The patched program builds and starts successfully. Bidirectional
IPv4 connectivity between two clients in different VLANs was verified.
This is a functional test, not a complete regression test.

I understand that FreeBSD 12.4 is EOL. This report concerns the ioctl
usage in parpd 1.3; I have not tested newer FreeBSD releases.

Could you please review this change for upstream and the FreeBSD port?

Thank you,
Oleksandr Baryshniev


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads