libnl icon indicating copy to clipboard operation
libnl copied to clipboard

nl_cache_mngr not compatible with NETLINK_LISTEN_ALL_NSID

Open reet- opened this issue 4 years ago • 0 comments

Hi,

The NETLINK_LISTEN_ALL_NSID sockopt can be used to receive Netlink messages from multiple namespaces, not just the one the Netlink socket was created in.

However, this option is currently incompatible with cache manager (or libnl in general?):

DBG<3>/build/libnl3-3.4.0/./lib/cache_mngr.c:498  nl_cache_mngr_poll: Cache manager 0x56242bacd960, poll() fd 3
DBG<3>/build/libnl3-3.4.0/./lib/cache_mngr.c:500  nl_cache_mngr_poll: Cache manager 0x56242bacd960, poll() returned 0
DBG<2>/build/libnl3-3.4.0/./lib/cache_mngr.c:535  nl_cache_mngr_data_ready: Cache manager 0x56242bacd960, reading new data from fd 3
DBG<3>/build/libnl3-3.4.0/./lib/nl.c:842  recvmsgs: Attempting to read from 0x56242bacd910
DBG<4>/build/libnl3-3.4.0/./lib/nl.c:724  nl_recv: recvmsg(0x56242bacd910): Received unexpected control dataDBG<3>/build/libnl3-3.4.0/./lib/cache.c:416  nl_cache_free: Decremented cache 0x56242bacdd40 <route/link> reference count, 1 remaining
DBG<3>/build/libnl3-3.4.0/./lib/cache.c:416  nl_cache_free: Decremented cache 0x56242bacdd40 <route/link> reference count, 0 remaining
DBG<2>/build/libnl3-3.4.0/./lib/cache.c:370  nl_cache_clear: Clearing cache 0x56242bacdd40 <route/link>...
DBG<4>/build/libnl3-3.4.0/./lib/object.c:222  nl_object_put: Returned object reference 0x56242bad4480, 2 remaining
DBG<4>/build/libnl3-3.4.0/./lib/object.c:222  nl_object_put: Returned object reference 0x56242bad4480, 1 remaining
DBG<2>/build/libnl3-3.4.0/./lib/cache.c:572  nl_cache_remove: Deleted object 0x56242bad4480 from cache 0x56242bacdd40 <route/link>.
...

Is there a way to make this work?

Cheers

reet- avatar Oct 28 '20 07:10 reet-