Thread (5 messages) flat view 5 messages, 3 authors, 7d ago

Re: [PATCH net-next 1/2] netlink: specs: nlctrl: fix the policy attribute numbering

From: Donald Hunter <donald.hunter@gmail.com>
Date: 2026-09-17 08:56:32

Jakub Kicinski [off-list ref] writes:
mask and pad are declared the wrong way round, giving mask 11 and
pad 12, while enum netlink_policy_type_attr has
NL_POLICY_TYPE_ATTR_PAD at 11 and NL_POLICY_TYPE_ATTR_MASK at 12.

The kernel emits the mask for every NLA_POLICY_MASK() attribute, so a
Python YNL client parsing a policy dump maps it onto pad and throws it
away - 30 of them in ethtool's policy alone.  In the other direction the
64-bit alignment padding, which the kernel does emit on architectures
without efficient unaligned access, is decoded as a u64 mask and blows
up the whole dump. But those architectures are rare.

The generated C parser is not affected, it keys the attributes off the
uAPI symbol names rather than off the values the spec derives.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help