Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Jun 2026 19:52:00 +0000
Message-ID:  <6a271d60.4146c.6180cf37@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=888d9236e2249cb1bda686aca8729fdcc69a10ac

commit 888d9236e2249cb1bda686aca8729fdcc69a10ac
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2026-06-05 19:16:53 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-06-08 19:51:35 +0000

    netlink: Use unsigned type in nl_process_nbuf
    
    nlmsghdr::nlmsg_len and nl_buf::offset are u_int.  Make msglen match.
    
    Reviewed by:    pouria, glebius
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D57474
---
 sys/netlink/netlink_io.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/netlink/netlink_io.c b/sys/netlink/netlink_io.c
index 9646eb2650d5..51c87d229717 100644
--- a/sys/netlink/netlink_io.c
+++ b/sys/netlink/netlink_io.c
@@ -345,9 +345,11 @@ nl_process_nbuf(struct nl_buf *nb, struct nlpcb *nlp)
 	};
 
 	for (; nb->offset + sizeof(struct nlmsghdr) <= nb->datalen;) {
+		u_int msglen;
+
 		hdr = (struct nlmsghdr *)&nb->data[nb->offset];
 		/* Save length prior to calling handler */
-		int msglen = NLMSG_ALIGN(hdr->nlmsg_len);
+		msglen = NLMSG_ALIGN(hdr->nlmsg_len);
 		NL_LOG(LOG_DEBUG3, "parsing offset %d/%d",
 		    nb->offset, nb->datalen);
 		npt_clear(&npt);


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a271d60.4146c.6180cf37>