snl_init_writer() always set the error flag as 'false'. Here is a fix suggestion: --- netlink_snl_old.h 2025-10-02 14:17:36.369302000 -0300 +++ netlink_snl.h 2025-10-02 14:17:56.411429000 -0300 @@ -1021,20 +1021,20 @@ }; static inline void snl_init_writer(struct snl_state *ss, struct snl_writer *nw) { + nw->error = false; nw->size = SNL_WRITER_BUFFER_SIZE; nw->base = (char *)snl_allocz(ss, nw->size); if (nw->base == NULL) { nw->error = true; nw->size = 0; } nw->offset = 0; nw->hdr = NULL; - nw->error = false; nw->ss = ss; } static inline bool snl_realloc_msg_buffer(struct snl_writer *nw, size_t sz)
^Triage: note inline patch, applying to sys/netlink/netlink_snl.h .
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=488718ff42346888243496c00cbeb42ba004171e commit 488718ff42346888243496c00cbeb42ba004171e Author: Bruno Silvestre <bruno.silvestre@gmail.com> AuthorDate: 2025-10-07 05:48:28 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2025-10-07 05:48:28 +0000 netlink: in snl_init_writer() don't overwrite error in case of failure PR: 290050 sys/netlink/netlink_snl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=794299ac6876ecdf62e503d3fb05bd388f5c8be7 commit 794299ac6876ecdf62e503d3fb05bd388f5c8be7 Author: Bruno Silvestre <bruno.silvestre@gmail.com> AuthorDate: 2025-10-07 05:48:28 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2025-10-15 18:57:46 +0000 netlink: in snl_init_writer() don't overwrite error in case of failure PR: 290050 (cherry picked from commit 488718ff42346888243496c00cbeb42ba004171e) sys/netlink/netlink_snl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
This commit needs to be MFCed to stable/14 as well. Gleb, will you handle it?
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=cf95eabb5572368c80d72c151ebebca8cf6b2dbc commit cf95eabb5572368c80d72c151ebebca8cf6b2dbc Author: Bruno Silvestre <bruno.silvestre@gmail.com> AuthorDate: 2025-10-07 05:48:28 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2025-11-21 16:52:01 +0000 netlink: in snl_init_writer() don't overwrite error in case of failure PR: 290050 (cherry picked from commit 488718ff42346888243496c00cbeb42ba004171e) sys/netlink/netlink_snl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)