From 624427e2e2bf16b96a2ee05cf6edfa3fd577fb96 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 2 Feb 2024 14:51:53 +0100 Subject: sys/linux: use a wider range for netlink attributes --- sys/linux/socket_netlink.txt | 11 +++++++---- sys/linux/socket_netlink.txt.const | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'sys/linux') diff --git a/sys/linux/socket_netlink.txt b/sys/linux/socket_netlink.txt index 310e8657c..79cfc10f5 100644 --- a/sys/linux/socket_netlink.txt +++ b/sys/linux/socket_netlink.txt @@ -113,16 +113,19 @@ type nlnest[TYPE, PAYLOAD] nlattr_tt[const[TYPE, int16:14], 0, 1, PAYLOAD] # nlattr with NLA_F_NET_BYTEORDER set (unused for now). type nlnetw[TYPE, PAYLOAD] nlattr_tt[const[TYPE, int16:14], 1, 0, PAYLOAD] +# NL80211 has probably the biggest number of netlink attributes. +include +define NETLINK_MAX_ATTRIBUTES NL80211_ATTR_MAX + nl_generic_attr [ generic array[int8] -# NL80211 has 150 attributes. - typed nlattr_tt[int16:14[0:150], 0, 0, nl_generic_attr_data] - nested nlattr_tt[int16:14[0:150], 0, 1, array[nl_generic_attr_nonested]] + typed nlattr_tt[int16:14[0:NETLINK_MAX_ATTRIBUTES], 0, 0, nl_generic_attr_data] + nested nlattr_tt[int16:14[0:NETLINK_MAX_ATTRIBUTES], 0, 1, array[nl_generic_attr_nonested]] ] [varlen] nl_generic_attr_nonested [ generic array[int8] - typed nlattr_tt[int16:14[0:150], 0, 0, nl_generic_attr_data] + typed nlattr_tt[int16:14[0:NETLINK_MAX_ATTRIBUTES], 0, 0, nl_generic_attr_data] ] [varlen] nl_generic_attr_data [ diff --git a/sys/linux/socket_netlink.txt.const b/sys/linux/socket_netlink.txt.const index 4cb65d069..d4ea2a439 100644 --- a/sys/linux/socket_netlink.txt.const +++ b/sys/linux/socket_netlink.txt.const @@ -18,6 +18,7 @@ NETLINK_ISCSI = 8 NETLINK_KOBJECT_UEVENT = 15 NETLINK_LISTEN_ALL_NSID = 8 NETLINK_LIST_MEMBERSHIPS = 9 +NETLINK_MAX_ATTRIBUTES = 329 NETLINK_NETFILTER = 12 NETLINK_NFLOG = 5 NETLINK_NO_ENOBUFS = 5 -- cgit mrf-deployment