[PATCH net v2 0/4] netlink: fixes for cross-namespace nsid reporting

Ilya Maximets posted 4 patches 4 days, 4 hours ago
net/netlink/af_netlink.c                  | 11 ++--
tools/net/ynl/pyynl/lib/ynl.py            | 37 ++++++++++++--
tools/testing/selftests/net/link_netns.py | 61 ++++++++++++++++++++++-
3 files changed, 99 insertions(+), 10 deletions(-)
[PATCH net v2 0/4] netlink: fixes for cross-namespace nsid reporting
Posted by Ilya Maximets 4 days, 4 hours ago
While working on some new features for OVS and OVN we discovered that
self-referential NSIDs get unintentionally allocated in the system as
well as unexpectedly reported for local events on all-nsid listeners.

More details in the patches.  They change user-visible behavior, but
the current behavior is arguably a bug, as it makes it hard to use
all-nsid sockets without a decent amount of extra unrelated work of
tracking when new NSIDs are allocated for your local namespace.

Tests are added to check the expected behavior and YNL is extended to
support all-nsid sockets in the tests.


Version 2:
 - The RTM_GETLINK change is dropped for now as it is not suitable for net.
   A fix would require an opt-in flag.  [Jiri, Nicolas]
 - Added a fix for 'nsid_is_set' flag not being reset between sockets. [Sashiko]
 - Refactored the ynl code:
   * Moved recvmsg call into a separate method. [Jakub]
   * Added doc-string for the ntf_listen_all_nsid. [Jakub]
   * Mentioned it in the Notifications API section.

Version 1:
 - https://lore.kernel.org/netdev/20260515201937.2813983-1-i.maximets@ovn.org/


Ilya Maximets (4):
  net: netlink: fix sending unassigned nsid after assigned one
  net: netlink: don't set nsid on local notifications
  tools: ynl: support listening on all nsids
  selftests: net: add a test case for nsid in all nsid notifications

 net/netlink/af_netlink.c                  | 11 ++--
 tools/net/ynl/pyynl/lib/ynl.py            | 37 ++++++++++++--
 tools/testing/selftests/net/link_netns.py | 61 ++++++++++++++++++++++-
 3 files changed, 99 insertions(+), 10 deletions(-)

-- 
2.53.0
Re: [PATCH net v2 0/4] netlink: fixes for cross-namespace nsid reporting
Posted by Jakub Kicinski 3 days, 6 hours ago
On Wed, 20 May 2026 19:22:34 +0200 Ilya Maximets wrote:
> Ilya Maximets (4):
>   net: netlink: fix sending unassigned nsid after assigned one
>   net: netlink: don't set nsid on local notifications
>   tools: ynl: support listening on all nsids
>   selftests: net: add a test case for nsid in all nsid notifications

Doesn't look like this will make it to today's PR but let me apply
just the ynl change right away, the same code is changed in net-next.
Let me save myself the merge conflict..