← Back to team overview

desktop-packages team mailing list archive

[Bug 1511735] Re: libnl: fail to bind() netlink sockets

 

Initial look at the patches results in the following assessment:

The first 2 patches apply fine to the version included in Ubuntu Trusty

027157898708 lib/socket: don't fail if no more local ports can be assigned in nl_socket_alloc
http://git.infradead.org/users/tgr/libnl.git/commitdiff/027157898708

0fd510b3673f lib/socket: use proper typed constant UINT32_MAX for uint32_t typed port
http://git.infradead.org/users/tgr/libnl.git/commitdiff/0fd510b3673f

But at

4dd5fdd0af2c lib/socket: retry generate local port in nl_connect on ADDRINUSE
http://git.infradead.org/users/tgr/libnl.git/commitdiff/4dd5fdd0af2c

This requires some additional plumbing changes in libnl3 that's not present in the version.  In particular,
the capabilities framework (utils.h/utils.c NL_CAPABILITY_*) and the individual linker scripts introduced here:

http://git.infradead.org/users/tgr/libnl.git/commitdiff/e7d57da0ddad9097962ebfec4f5202b756ed93c9

It seems non-trivial (I've not studied all of libnl3 library code yet)
and (somewhat risky) to backport the capabilities which may change
behavior of the library (destabilizing existing users) and normally
beyond the scope of a bug fix that's SRU'able.

We'd need to retain the logic of the fix, but port it to the level of
libnl3 we have.    I'd be happy to pick this back up if the we get a
reworked patch 3 and 4 that don't require backporting additional
infrastructure into libnl3.

Additional feedback, the test-case included was somewhat awkward in that
it orphans the first process without any cleanup.  Test-cases should
strive to exit non-zero on failure for easier integration into test
frameworks.  It would be good to see about integrating the test into the
existing tests of the project, but that's a nice to have.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to libnl3 in Ubuntu.
https://bugs.launchpad.net/bugs/1511735

Title:
  libnl: fail to bind() netlink sockets

Status in libnl3 package in Ubuntu:
  Fix Released
Status in libnl3 source package in Trusty:
  New

Bug description:
  The following upstream patches are needed in order to avoid failures
  when binding a netlink socket:

  1f734a8f892a lib/socket: randomize the generated local port
  http://git.infradead.org/users/tgr/libnl.git/commitdiff/1f734a8f892a

  4dd5fdd0af2c lib/socket: retry generate local port in nl_connect on ADDRINUSE
  http://git.infradead.org/users/tgr/libnl.git/commitdiff/4dd5fdd0af2c

  027157898708 lib/socket: don't fail if no more local ports can be assigned in nl_socket_alloc
  http://git.infradead.org/users/tgr/libnl.git/commitdiff/027157898708

  0fd510b3673f lib/socket: use proper typed constant UINT32_MAX for uint32_t typed port
  http://git.infradead.org/users/tgr/libnl.git/commitdiff/0fd510b3673f

  Without these patches, an application which opens and closes regularly
  netlink sockets can easily fails to bind them.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libnl3/+bug/1511735/+subscriptions