summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Donald2024-12-13 03:17:50 +0000
committerRobert Marko2025-04-02 08:58:38 +0000
commit61ae5732adea8bafcdf158c979a0a0d68b2cff62 (patch)
tree1cf95ac479ceace1ad6b7093f3bc6f04c2af4038
parentea01ed41f3212ecbe000422f3c122a01b93fe874 (diff)
downloadnetifd-61ae5732adea8bafcdf158c979a0a0d68b2cff62.tar.gz
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 <newtwen+github@gmail.com> Link: https://github.com/openwrt/netifd/pull/42 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--system-linux.c2
1 files changed, 1 insertions, 1 deletions
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);
}