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/[email protected]/ 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

