Files
netlinkrb/lib/linux/netlink
nick cac6e7698b Fix a multiple-sockets-in-one-process issue.
"pid" is not "process id" in netlink, but rather, "port id". If you bind to a
sockaddr == 0 then Linux automatically assigns your socket a port id - which
happens to be the same as the process ID for the first one concurrently open.

For the second and subsequent concurrently-open sockets, binding 0 (as most
users of this library will do) gets you back a random high-numbered port id.

This change preserves the existing use case (one port open in the process,
binding to 0) while fixing multiple-ports-open-in-the-same-process, socket-is-
passed-in-and-pid-is-not-specified, and specific-pid-is-requested-but-could-
not-bind-to-it.

We're probably still not thread-safe - the seq handling looks dodgy - but at
least now we can use multiple sockets in separate threads and have them all
work.

Using the same socket from multiple threads is a slightly niche use case, and
it's tempting to say "don't do this" instead...
2014-04-15 15:10:39 +01:00
..
2011-05-06 09:49:47 +01:00
2011-05-06 09:49:47 +01:00
2012-07-05 14:54:42 +01:00