Article View: muc.lists.freebsd.ports
Article #161[PATCH] net/parpd: use BIOCSDIRECTION to set inbound-only BPF capture
From: alexandr.baryshnyev
Date: Wed, 11 Nov 2026 16:23
Date: Wed, 11 Nov 2026 16:23
53 lines
4999 bytes
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
Technical Details
Message-ID:
<a037fbd2-8437-43b8-96b8-78cd1342762a@gmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!usenet.goja.nl.eu.org!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!usenet.goja.nl.eu.org!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail From: alexandr.baryshnyev@gmail.com Newsgroups: muc.lists.freebsd.ports Subject: [PATCH] net/parpd: use BIOCSDIRECTION to set inbound-only BPF capture Date: Wed, 11 Nov 2026 18:23:25 +0200 Organization: Eksi.Net Approved: news-admin@muc.de Distribution: world Message-ID: <a037fbd2-8437-43b8-96b8-78cd1342762a@gmail.com> Reply-To: abb@eksi.net MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2"; logging-data="82685"; mail-complaints-to="news-admin@muc.de" User-Agent: Mozilla Thunderbird DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794414245; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=ZwovQubd/wLrCkqXV4UUEkkgOgDBlLBK2hvlDqkhxtI=; b=OYWWGb/EiN2r5+J8AwBLE6sB3QyjcHNFwCVUP+oN4C7UEOSzGndXi4mbLilwcioVVPO2// rUhvRByolYb4cpJzyjhCz0aYF+cS3YWytDGc2nwLdSVH53ehIhXmw6pZMlB7qqmdeOSDiK 0kH1TCABbs8+Ghwq5c68V2TruTUFIQn0h82tzzhqdsSsJQFX5ZG9vdcKtaKcQB7xkXA72v Ber3xr3GFDlQnGpG84krDYCqXv+CIG+8WMeG5A4dbv3VjLr3ADcWv9VuVtQDatPLWgXrlJ 073OTgLD/jcSxcwGME3r8EBkIkZ0a+zm1Nv6PJehnzqRVMzTfqGWsptrQOxbng== X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 194.44.253.2 is neither permitted nor denied by domain of alexandr.baryshnyev@gmail.com) smtp.mailfrom=alexandr.baryshnyev@gmail.com X-BeenThere: freebsd-ports@freebsd.org Precedence: list Content-Language: uk-UA, en-US, ru X-Rspamd-Queue-Id: 4jPpjt5Jrmz4j1m X-Spamd-Bar: / X-Spamd-Result: default: False [0.00 / 15.00]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:3255, ipnet:194.44.253.0/24, country:UA]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; HAS_ORG_HEADER(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; FROM_NO_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-ports@FreeBSD.org]; REPLYTO_DN_EQ_FROM_DN(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; FROM_EQ_ENVFROM(0.00)[]; HAS_REPLYTO(0.00)[abb@eksi.net]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; ALIAS_RESOLVED(0.00)[]; REPLYTO_DOM_NEQ_TO_DOM(0.00)[] X-Newsgate-Id: f02c70b8849f+ X-No-Archive: Yes