Skip to content

Fix NFQ verdict failure by converting packet ID to host byte order#381

Open
lfking wants to merge 1 commit intomrash:masterfrom
lfking:bugfix/nfq_verdict_id_endian_mismatch
Open

Fix NFQ verdict failure by converting packet ID to host byte order#381
lfking wants to merge 1 commit intomrash:masterfrom
lfking:bugfix/nfq_verdict_id_endian_mismatch

Conversation

@lfking
Copy link
Copy Markdown

@lfking lfking commented Feb 4, 2026

The nfq_set_verdict function in libnetfilter_queue expects the
packet ID in Host Byte Order, as it performs its own internal
conversion to Network Byte Order (Big-Endian).

The current implementation was passing the raw Big-Endian ID
retrieved from the header directly to the library. On Little-Endian
architectures (x86_64), this resulted in a double-swap, causing
the kernel to reject verdicts with ENOENT and eventually leading
to NFQUEUE saturation and daemon silence.

This fix wraps ph->packet_id in ntohl() to ensure the library
receives the ID in the expected Host Byte Order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant