Skip to content

RFC libnftnl: Incorrect res_id byte order?

Ian Pilcher netfilter-devel 1 version Applied

Status from this message: Applied to libnftnl, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest1 patch 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/1libnftnl: Fix res_id byte ordersrc/common.c+2 -14 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/1] libnftnl: Incorrect res_id byte order?

I am marking this as an RFC and including this cover letter, because I'm not absolutely 100% sure that the current code is incorrect. (It obviously works, or this would have come up before.)

AFAICT, the res_id of struct nfgenmsg is supposed to be in network byte order, and that isn't happening on little endian systems. nftnl_batch_begin() and nftnl_batch_end() both pass NFNL_SUBSYS_NFTABLES
(10) to __nftnl_nlmsg_build_hdr(), but without a call to htons(), the message contains 2560 (when interpretted in network byte order).

Ian Pilcher (1):
libnftnl: Fix res_id byte order

 src/common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

base-commit: 461f36979f4ed2b6cc95f06cf5f9c3c84bdf9e70

Signature · 1 line
2.37.3