All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libmnl v2 0/2] fprintf trailing bytes, errno sign workaround
@ 2026-11-21 14:34 Florian Stosse
  2026-11-21 14:34 ` [PATCH libmnl v2 1/2] nlmsg: do not read past nlmsg_len in mnl_nlmsg_fprintf() Florian Stosse
  2026-11-21 14:34 ` [PATCH libmnl v2 2/2] callback: remove the errno sign workaround in mnl_cb_error() Florian Stosse
  0 siblings, 2 replies; 4+ messages in thread
From: Florian Stosse @ 2026-11-21 14:34 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo, Florian Stosse

Hi Pablo,

Thanks for applying patches 1-3. This v2 reworks the other two patches
of the series:
https://lore.kernel.org/netfilter-devel/20261106191841.1645-1-florian.stosse@harvester.fr/

Patch 1 makes mnl_nlmsg_fprintf() print the 1 to 3 bytes left at the
end of an unaligned message on a last row labelled "trailing bytes",
instead of reading past the message. Aligned messages print exactly as
before.

Patch 2 removes the errno sign workaround in mnl_cb_error(), as you
suggested. It removes the branch for positive values and keeps the
negation, because the kernel sends a negative errno. So -INT_MIN can
still be computed for a hand-built NLMSG_ERROR, although the kernel never
sends that value. The note in the patch has the details and a
branch-free alternative, in case you want that case gone too.

Florian Stosse (2):
  nlmsg: do not read past nlmsg_len in mnl_nlmsg_fprintf()
  callback: remove the errno sign workaround in mnl_cb_error()

 src/callback.c |  6 +-----
 src/nlmsg.c    | 16 +++++++++++++++-
 2 files changed, 16 insertions(+), 6 deletions(-)

-- 
2.56.0.windows.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-21 23:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-21 14:34 [PATCH libmnl v2 0/2] fprintf trailing bytes, errno sign workaround Florian Stosse
2026-11-21 14:34 ` [PATCH libmnl v2 1/2] nlmsg: do not read past nlmsg_len in mnl_nlmsg_fprintf() Florian Stosse
2026-11-21 23:46   ` Pablo Neira Ayuso
2026-11-21 14:34 ` [PATCH libmnl v2 2/2] callback: remove the errno sign workaround in mnl_cb_error() Florian Stosse

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.