git: 14bbf0943308 - stable/14 - netlink: fix casts

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Fri, 08 Mar 2024 09:11:34 UTC
The branch stable/14 has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=14bbf0943308a53fdca3779334f6dde2c62fb0cd

commit 14bbf0943308a53fdca3779334f6dde2c62fb0cd
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2024-02-26 10:18:30 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2024-03-08 09:11:15 +0000

    netlink: fix casts
    
    Reviewed by:    melifaro
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D44088
    
    (cherry picked from commit 48f33b55b0148c3c8991e53156f37c42b8bc22e9)
---
 sys/netlink/netlink_message_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netlink/netlink_message_parser.c b/sys/netlink/netlink_message_parser.c
index bf0140c98120..614bc96ab9f4 100644
--- a/sys/netlink/netlink_message_parser.c
+++ b/sys/netlink/netlink_message_parser.c
@@ -321,7 +321,7 @@ nlattr_get_uint8(struct nlattr *nla, struct nl_pstate *npt, const void *arg, voi
 		    nla->nla_type, NLA_DATA_LEN(nla));
 		return (EINVAL);
 	}
-	*((uint16_t *)target) = *((const uint16_t *)NL_RTA_DATA_CONST(nla));
+	*((uint8_t *)target) = *((const uint8_t *)NL_RTA_DATA_CONST(nla));
 	return (0);
 }