reusing genl sockets via libnl

Doug Maxey dwm at austin.ibm.com
Sun Nov 15 14:32:14 EST 2009


Howdy!

I am writing an application interface to a driver that has a control
plane implemented as genl socket command interface using libnl and
have noticed some interesting (at least to me) behavior on powerpc64.
The device (which has a number of moving parts) interface is fairly
complicated.  The number of genl commands used for this instance is on
the upper side of 50.

When looking at the existing example implementations, noticed that the
examples all use the

create a socket
use it once
close the socket

model.  Is that a requirement?

It would be really nice if there could be a long lived socket that
could be

1) be reused for at least some subset of the commands, resetting what
   the expected command / response via nl_socket_modify_cb().

2) a single socket (or a few) that would be expected to last the
   lifetime of the application so a watcher could notice if the app
   dies and clean up the resource that were claimed by the app.

Tried to set up such a socket, but it appears that -any- command after
the first appears to never return anything other than no error on the
operation.  The callback is never invoked.

Is this the expected behavior, or a powerpc bug?  Where is the
expected behavior documented?


++doug







More information about the libnl mailing list