From nobody Sun Jul 5 14:15:56 2026 X-Original-To: dev-commits-src-main@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 4gtTzx1j0Cz6kL63 for ; Sun, 05 Jul 2026 14:15:57 +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 4gtTzw5ySzz3Cnb for ; Sun, 05 Jul 2026 14:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1783260956; 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=UOjGlxog+MNNYqx+CDQjnlOSOCrdtoijNT/EFEo9vl0=; b=jcNZJEai5r/aaBb/Q80WIPcm4c6/Jxm2tIeMKp7aapbT6Apv1cBEgeKNLlQZBJsr3juFDs nU72sgHX4ENLp52pTx3u3nsGbY9xwBWw36HyiV0vdMp/cjyPKXWVQaSxLPiwsOj8wVRaCJ FUxVrmdQ/4MR+5v3wpXeTlKduh1dm5yXS3h1N2fHw+sEvy91Y4e7Qp7lkYKdkfp0c/NMVC lrV23az4j/Dnk3K1LrjbPZ4A7C/ZoKrFhm5YBhAadhouccf1AaWbN1CycmFhRsTPJ/uuZ/ sAc6d9HVPHGdIORddYJFT09P8oyMxYHWBmBwiDU//PSTiT0DU1omEf26vEskrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1783260956; a=rsa-sha256; cv=none; b=Xq6bpJdO++Ffv85grS7V8V/q2ogy8CLveHhc/+1PCc/MRC4GsIRTdpU65e4KWeDypSSaMn 9Jmy5tP81vIWBgPm1wLnOSvKeJn+C5wLDUco07XBVdD4l6q0O5p8BcOkZOvWi1xoF3WmMB PCdtOiMS1UvjOJgzVyCqS1UV1RhBV9YT+bpHk8htNm/sfSYaOFkH7fdeIf7yZofaNAKpbe VFF2sBqGpEmew8EoveDo9V0OQpwnsrxqvzo45tr/Xzxd7agFm6FPVc1/mmr673n9R6o47w U6DVL3jBJjtn/mKabFNlktzhvHPsJqsz2UPygbUm/lg0UvVN2mvs6qRjHRqPZQ== 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=1783260956; 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=UOjGlxog+MNNYqx+CDQjnlOSOCrdtoijNT/EFEo9vl0=; b=ai3HJyRxyT7cSwhiaIs2js5i7YfviNS7mQh0w+E5uarWrOm+TOakj25O9fqvuzTPbPFR/H h95AiEj0xRNFAa4qPlScaAo9/CCCf2HJE8znS7lOgC6V2ZkP8t1oEFlWr57fHQGUIqUloS pkAIjMo7+e5mbhNLgbLjUvMSJoaheSAnMkwMtN0LufRo+CUhMZXlVfWQy0TM1bwlHrr21T W/qkTQFgJXLuzOYTKUP4SazmFi5XOWm4glQf8Z8T/ilhDhGs0CD+f6naKPBLx92ZAAMQmn WBVRf0XfX5CB41diiuTaqT7NBkLgcgolZ84gdhXROiTcw3Wn0JPvLMYhuWIGEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gtTzw4lXBz5WZ for ; Sun, 05 Jul 2026 14:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3bb76 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 05 Jul 2026 14:15:56 +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: fa50691ecf87 - main - libsysdecode: decode PF Generic Netlink commands List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: fa50691ecf87c2d0ec35480222557173c11a5baa Auto-Submitted: auto-generated Date: Sun, 05 Jul 2026 14:15:56 +0000 Message-Id: <6a4a671c.3bb76.7053e1@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fa50691ecf87c2d0ec35480222557173c11a5baa commit fa50691ecf87c2d0ec35480222557173c11a5baa Author: Ishan Agrawal AuthorDate: 2026-06-29 06:21:59 +0000 Commit: Kristof Provost CommitDate: 2026-07-05 14:04:06 +0000 libsysdecode: decode PF Generic Netlink commands Decode the Generic Netlink command header for messages belonging to the PF Generic Netlink family. Display the command name using the PF Generic Netlink command decoder. Signed-off-by: Ishan Agrawal Reviewed by: kp Sponsored-by: Google LLC (GSoC 2026) --- lib/libsysdecode/netlink.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/lib/libsysdecode/netlink.c b/lib/libsysdecode/netlink.c index a9c226e6065d..ce8ac0485009 100644 --- a/lib/libsysdecode/netlink.c +++ b/lib/libsysdecode/netlink.c @@ -29,6 +29,18 @@ static struct name_table *family_table = NULL; static size_t num_family = 0; +static void +sysdecode_netlink_pf(FILE *fp, const struct genlmsghdr *genl) +{ + uint8_t cmd = genl->cmd; + const char *cmd_name = sysdecode_pfnl_cmd(cmd); + + if (cmd_name != NULL) + fprintf(fp, "cmd=%s", cmd_name); + else + fprintf(fp, "cmd=%u", cmd); +} + bool sysdecode_netlink(FILE *fp, const void *buf, size_t len, int protocol) { @@ -160,8 +172,21 @@ sysdecode_netlink(FILE *fp, const void *buf, size_t len, int protocol) } const char *family = lookup_value(family_table, nl->nlmsg_type); - if (family != NULL && strcmp(family, "pfctl") == 0) - fprintf(fp, ",pf={}"); + + if (family != NULL && protocol == NETLINK_GENERIC) { + fprintf(fp, ",%s={", family); + + if (strcmp(family, "pfctl") == 0) { + const struct genlmsghdr *genl = + (const struct genlmsghdr *)(const void *) + ((const char *)nl + + sizeof(struct nlmsghdr)); + + sysdecode_netlink_pf(fp, genl); + } + + fprintf(fp, "}"); + } /* Handle Alignment (Netlink messages are 4-byte aligned). */ size_t aligned_len = NLMSG_ALIGN(nl->nlmsg_len);