Thread (11 messages) flat view 11 messages, 5 authors, 18d ago

Re: [PATCH net-next 3/3] netlink: specs: fou: link the type attribute to the encap-type enum

From: Nicolas Dichtel <hidden>
Date: 2026-09-07 10:05:29

Le 04/09/2026 à 21:14, Jakub Kicinski a écrit :
The spec defines encap-type (unspec / direct / gue), but no attribute
references it, so the definition exists only to emit FOU_ENCAP_* into
the uAPI header - while FOU_ATTR_TYPE is exactly that value space:
fou_create() switches on FOU_ENCAP_DIRECT / FOU_ENCAP_GUE and returns
-EINVAL for anything else. Python YNL could not accept or display the
names and the generated C exposed a raw __u8 setter.

The global policy entry becomes NLA_POLICY_MAX(NLA_U8, 2). For add
that only moves the existing fou_create() rejection earlier; del and
get ignore FOU_ATTR_TYPE altogether, so a bogus type there now fails
validation instead of being dropped on the floor.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Nicolas Dichtel <redacted>

Side note: the field 'type' in 'struct fou_cfg' and 'struct fou' is a u16.
Having an u8 would be more consistent (:
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help