LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-05-2020, 02:31 AM   #1
param1992
LQ Newbie
 
Registered: Dec 2020
Posts: 1

Rep: Reputation: Disabled
Netlink Messages from Namespaces


Hi All,

We have been using an application where we would require to monitor the netlink messages from all namespaces. Initial design is we had created one process per namespace and each process would open a socket in its own namespace and listen for netlink notifications. But this approach is not scalable to have one process per namespace.

I did come across setns system call which would change the namespace of the current process context and open a socket in that namespace and return back to the default namespace.In addition I used this command ip netns set NETNSNAME NETNSID which when used "NETLINK_LISTEN_ALL_NSID" in the socket option would receive netlink notification from multiple namespaces where the ID being passed in the ancillary date of the recvmsg system call. This seems to be working fine in most of the cases, but I do see issues when the interfaces are moved across namespaces in quick succession where the add IP netlink message did not have an ID associated which was set during the ip netns set call. Even though the message arrived because of the quick succession of moving the interfaces across namespaces I am thinking if there might be any race conditions. Also in few cases the ipv6 add route netlink message was missing even though the route was present in the table.

So what I would like to know is because of these quick succession of executing these commands in namespace, can there be any race conditions existing. Also I would like to know once ip netns set NETNSNAME NETNSID command is executed when can we reliably start executing the commands in the namespace.

Any pointers would be really helpful.

Thanks.
Param
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Schema Namespaces and element redefinition Omni Programming 1 09-22-2006 09:52 AM
Newb stuck on namespaces (C++) rusty_turkey Programming 2 06-08-2006 10:11 PM
C++: recursive #including: partial namespaces? R00ts Programming 4 03-09-2005 12:15 AM
Namespaces ChemicalBurn Programming 10 02-16-2005 09:49 AM
using multiple namespaces over in C++ R00ts Programming 1 09-22-2004 04:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 04:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration