[DragonFlyBSD - Bug #3387] The BPF interpreter should support XOR and MOD operations
sigttou
bugtracker-admin at leaf.dragonflybsd.org
Sun Oct 4 22:41:57 PDT 2026
Issue #3387 has been updated by sigttou.
File 0001-bpf-xor-mod.patch added
This adds XOR and modulo with constant and register operands to both the interpreter and validator. Constant modulo by zero is rejected; a register zero divisor returns zero, matching division handling.
It follows guy's FreeBSD-derived patch, with the missing XOR validator cases added and the manual's BPF_OD typo corrected.
----------------------------------------
Bug #3387: The BPF interpreter should support XOR and MOD operations
http://bugs.dragonflybsd.org/issues/3387#change-14774
* Author: guy
* Status: New
* Priority: Normal
* Category: Feature request
* Target version: 6.6
* Start date: 2025-11-09
----------------------------------------
Linux introduced two new BPF instructions - BPF_XOR, doing a exclusive-or, and BPF_MOD, doing a C-style modulo operation.
NetBSD and FreeBSD have added them as well, as has libpcap's user-mode interpreter, and libpcap's compiler for filter expressions supports XOR and modulo perationsl
I've attached a patch to add this to the DragonFly BSD interpreter, based on the FreeBSD change; I have not tested it, but it should be a straightforward change.
---Files--------------------------------
patch.txt (2.12 KB)
0001-bpf-xor-mod.patch (3.1 KB)
--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account
More information about the Bugs
mailing list