Subject: Re: RTM_NEWLINK not received by application when connecting multiple devices simultaneously

From: Stephen Hemminger <[email-masked]>
Date: Fri, 20 Apr 2012 09:15:59 -0700

On Fri, 20 Apr 2012 18:04:49 +0200
Kristian Evensen <[email-masked]> wrote:

> I have uploaded a compressed version of my listener code here:
> http://pastebin.com/f1NPYGSh
> 
> The othe operations my application do related to netlink, is to
> configure the sockets. Could it be that the configuration messages
> somehow disturb the retrieval of other messages, as they all use the
> same mnl_sock? None of them requests any replies (they are all
> RTM_NEW*/NLM_F_CREATE), but I am not sure about the internal working
> of netlink.

Most applications using netlink listening have two sockets, one
for events the other for requests. The problem is that your own requests
will generate events and it is hard to tell what to expect next
the response (ACK) or the async event when using the same socket.