From: Paul Donald Date: Fri, 13 Dec 2024 03:17:50 +0000 (+0100) Subject: iprule: amend ipproto netlink nla_put_u32 to nla_put_u8 X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=61ae5732adea8bafcdf158c979a0a0d68b2cff62;p=project%2Fnetifd.git iprule: amend ipproto netlink nla_put_u32 to nla_put_u8 FRA_IP_PROTO expects an 8 bit value. Follow-up fix for d29cf707478cfc5465fc8a7b8ccfde72a739a4f6. uint8 prevents the kernel log message: netlink: 'netifd': attribute type 22 has an invalid length. The message is otherwise harmless; ip rules using ipproto are created successfully. Tested on 24.10-snapshot Signed-off-by: Paul Donald Link: https://github.com/openwrt/netifd/pull/42 Signed-off-by: Robert Marko --- diff --git a/system-linux.c b/system-linux.c index 3fff641..945ca4c 100644 --- a/system-linux.c +++ b/system-linux.c @@ -3578,7 +3578,7 @@ static int system_iprule(struct iprule *rule, int cmd) nla_put_u32(msg, FRA_GOTO, rule->gotoid); if (rule->flags & IPRULE_IPPROTO) - nla_put_u32(msg, FRA_IP_PROTO, rule->ipproto); + nla_put_u8(msg, FRA_IP_PROTO, rule->ipproto); return system_rtnl_call(msg); }