From nobody Mon Jul 27 09:28:18 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4h7tYt67YNz6mgmf for ; Mon, 27 Jul 2026 09:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h7tYt5QQZz4N2G for ; Mon, 27 Jul 2026 09:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785144498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cUff2PZUkrgzurpDAfMud+K9IxyOSudzsrX5wYExakk=; b=KAK7a94D1Qni2Y+ICfiV7ZcO0H6GD+d9C13hgwT9N/kBmOWnhFCS9NkG8BgZZhcUoNzJHA rnHnJXp6KfIFfNBYkadNIESxojN6GGa67WQrbfgi/qTCC5jLxuiGda1WYZar4HQGxfxCza 3NA+AuPdicgy7+dWsv6vqvKrAnGXZxlgCzLvXzuHgi/N2PKC7xxrunI4Sh0EBf/n9SV7oo BrXcc5cGHDI/7EX6ATMD5IzbE3WFFIW7AEHX3EOVaEUR1YnYwsjueP8Dxpo36UPuaTFFpI S0gNiSrpSkPTX7LF1xHCqNcNPS349MXM1Kt5oJkNbarzlqJVBdQ4JrM3zrMrKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785144498; a=rsa-sha256; cv=none; b=K4lbSDaDzPxcUXsQEl47dlPYrRYm9KhRU9ipZDhC+AfTwHLH0xUo1ky5FEwatbCnUiZkOx lgTxekL+Cr3BsCO6WC03PRrN7E6C+Qx39kgC70QgWHykPZ4HvEB8cJaTuPXhUEEXtZsVNM Vi5lJQcETOPiodGdvM5eG4AjSP2JRuzL26+vYeg/HtBfKlURhQuUJ8244p0YCONfhViWgJ nu4USRT2+mqd+8aecQ9fYIFIGPd4srE25ptwtXiF3zI4loT+x3f0VahI/cd7a29sYOAnmZ L1APE4mUsIIatyWMDHrIiyHNVdaGd/z8MIbnKjaQXVesDZcTbjgUhxEvO1MB9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785144498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cUff2PZUkrgzurpDAfMud+K9IxyOSudzsrX5wYExakk=; b=MMs68AtIkbkVOdgbDMy0uv/njiibp5En5WFi8MZp5IvvG5sGEm3WaF/Dj9iRDYUklEBwlO enTDJ7Nx3WciCQcTxIcibq4KqOaE0GwaEAenVwTEm3FwA0ZDJJWqv42Ehd35etB8sMNtuT yR4F9YxlOCZZCbxhfMojLf8tPW2Viu719GsOqiMVS/hofRfD51+ReF1Pl79qeVpjDZJVjM SOb9/xH1jlK6vmz/mKcOqrX9/Ffnr6DO9ieyQf2chp4Ml3wikooc/vG+sE5KUuW5pHQshJ jjmqfnns15jeNA1VjVKD+yUXv6ct6BpXercD9dmytKh78ERfvJvxyaiBvnqF1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h7tYt3wktz12bm for ; Mon, 27 Jul 2026 09:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19b7e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 27 Jul 2026 09:28:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Ishan Agrawal From: Kristof Provost Subject: git: 407b7bcc9386 - main - libsysdecode: decode combined Netlink message flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 407b7bcc93862fe0c026e254bac8ec0e8318e7e6 Auto-Submitted: auto-generated Date: Mon, 27 Jul 2026 09:28:18 +0000 Message-Id: <6a6724b2.19b7e.6b2f266a@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=407b7bcc93862fe0c026e254bac8ec0e8318e7e6 commit 407b7bcc93862fe0c026e254bac8ec0e8318e7e6 Author: Ishan Agrawal AuthorDate: 2026-07-23 02:29:48 +0000 Commit: Kristof Provost CommitDate: 2026-07-27 09:27:54 +0000 libsysdecode: decode combined Netlink message flags Change sysdecode_nlm_flag() to decode Netlink message flags as a bitmask instead of looking up a single flag value. This correctly prints combinations of NLM_F_* flags while preserving any unknown bits in hexadecimal. Reported by: androvonx95 Reviewed by: kp Signed-off-by: Ishan Agrawal Sponsored-by: Google LLC (GSoC 2026) --- lib/libsysdecode/flags.c | 11 ++++++++--- lib/libsysdecode/netlink.c | 7 +------ lib/libsysdecode/sysdecode.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/libsysdecode/flags.c b/lib/libsysdecode/flags.c index f94fb88ebf83..880fe5e1ed49 100644 --- a/lib/libsysdecode/flags.c +++ b/lib/libsysdecode/flags.c @@ -1217,9 +1217,14 @@ sysdecode_pfnl_cmd(int cmd) return (lookup_value(pfnl_cmd, cmd)); } -const char * -sysdecode_nlm_flag(int flag) +void +sysdecode_nlm_flag(FILE *fp, int flags) { - return (lookup_value(nlm_flag, flag)); + int rem; + + if (!print_mask_int(fp, nlm_flag, flags, &rem)) + fprintf(fp, "0x%x", rem); + else if (rem != 0) + fprintf(fp, "|0x%x", rem); } diff --git a/lib/libsysdecode/netlink.c b/lib/libsysdecode/netlink.c index bb07ad2e4bf7..6e2af72374b0 100644 --- a/lib/libsysdecode/netlink.c +++ b/lib/libsysdecode/netlink.c @@ -287,11 +287,7 @@ sysdecode_netlink(FILE *fp, const void *buf, size_t len, int protocol) } fprintf(fp, "flags="); - const char *nlm_f = sysdecode_nlm_flag(nl->nlmsg_flags); - if (nlm_f != NULL) - fprintf(fp, "%s", nlm_f); - else - fprintf(fp, "0x%x", nl->nlmsg_flags); + sysdecode_nlm_flag(fp, nl->nlmsg_flags); fprintf(fp, ",seq=%u,pid=%u", nl->nlmsg_seq, nl->nlmsg_pid); @@ -371,7 +367,6 @@ sysdecode_netlink(FILE *fp, const void *buf, size_t len, int protocol) family_table[num_family] = (struct name_table){0, NULL}; } - fprintf(fp, "}"); break; default: diff --git a/lib/libsysdecode/sysdecode.h b/lib/libsysdecode/sysdecode.h index bd38bb5bdc42..513ecddf07bd 100644 --- a/lib/libsysdecode/sysdecode.h +++ b/lib/libsysdecode/sysdecode.h @@ -67,7 +67,7 @@ void sysdecode_kevent_fflags(FILE *_fp, short _filter, int _fflags, int _base); const char *sysdecode_itimer(int _which); const char *sysdecode_pfnl_cmd(int _cmd); -const char *sysdecode_nlm_flag(int _flag); +void sysdecode_nlm_flag(FILE *_fp, int _flag); const char *sysdecode_kevent_filter(int _filter); bool sysdecode_kevent_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_kldsym_cmd(int _cmd);