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
This commit is contained in:
Ed Maste
2026-06-05 15:16:53 -04:00
parent 0b269737f9
commit 888d9236e2
+3 -1
View File
@@ -345,9 +345,11 @@ nl_process_nbuf(struct nl_buf *nb, struct nlpcb *nlp)
}; };
for (; nb->offset + sizeof(struct nlmsghdr) <= nb->datalen;) { for (; nb->offset + sizeof(struct nlmsghdr) <= nb->datalen;) {
u_int msglen;
hdr = (struct nlmsghdr *)&nb->data[nb->offset]; hdr = (struct nlmsghdr *)&nb->data[nb->offset];
/* Save length prior to calling handler */ /* 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", NL_LOG(LOG_DEBUG3, "parsing offset %d/%d",
nb->offset, nb->datalen); nb->offset, nb->datalen);
npt_clear(&npt); npt_clear(&npt);