On Wed, 2006-08-02 at 23:41 +0200, Hasso Tepper wrote:
> jamal wrote:

> > At the moment if a route (v6 or v4) was added by quagga and i had a
> > socket that was listening in a different process - what pid will i see
> > (in my user space app)? Is it of the quagga process or is it 0?
> 
> No, it's 0xffffefff for most of Quagga users. The reason behind is that 
> Quagga uses the first netlink socket it opens only for listening 
> multicast groups. For sending messages to the kernel it opens second 
> socket. Quagga lets kernel assign nl_pid's to the socket (by setting it 
> to 0 before calling bind()). The first socket gets nl_pid equal to 
> process pid of quagga (actually it's zebra daemon of quagga suite ;) and 
> the second gets (0 - 4097) -

Right - this is what i referred to as "the negative number". if you add
a third socket it will go below 0xffffefff etc
  
> net/netlink/af_netlink.c:netlink_autobind() for details.
> 
> As far as I understand it - the only connection between process pid and 
> nl_pid member in sockaddr_nl structure is that Alexey happened to use pid 
> of the process opening netlink socket as base of algorithm assigning 
> unique unicast address to this socket if application doesn't set it 
> itself (ie. it's 0 before calling bind()).

So the question is what would be the "address"/nl_pid of something
issued by an ioctl (refer to my earlier email to Alexey).

cheers,
jamal 

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to