Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

netkit: Don't emit scrub attribute for single device mode

When userspace reads a single mode netkit device via RTM_GETLINK,
it receives IFLA_NETKIT_SCRUB=NETKIT_SCRUB_DEFAULT attribute from
netkit_fill_info(). If that attribute is echoed back to recreate
the device, the seen_scrub presence check in netkit_new_link()
causes creation to fail with -EOPNOTSUPP. Since it has no meaning
for single devices at this point, just don't dump it.

Fixes: 481038960538 ("netkit: Add single device mode for netkit")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/20260410072334.548232-1-daniel@iogearbox.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Daniel Borkmann and committed by
Jakub Kicinski
e530b484 469faa54

+2 -1
+2 -1
drivers/net/netkit.c
··· 1214 1214 return -EMSGSIZE; 1215 1215 if (nla_put_u32(skb, IFLA_NETKIT_MODE, nk->mode)) 1216 1216 return -EMSGSIZE; 1217 - if (nla_put_u32(skb, IFLA_NETKIT_SCRUB, nk->scrub)) 1217 + if (nk->pair == NETKIT_DEVICE_PAIR && 1218 + nla_put_u32(skb, IFLA_NETKIT_SCRUB, nk->scrub)) 1218 1219 return -EMSGSIZE; 1219 1220 if (nla_put_u16(skb, IFLA_NETKIT_HEADROOM, dev->needed_headroom)) 1220 1221 return -EMSGSIZE;