On 09/27/2013 08:07 AM, Marek Lindner wrote:
On Thursday 26 September 2013 10:29:49 Matthias
batman-adv saves its table of packet handlers as
a global state, so handlers
must be set up only once (and setting them up a second time will fail).
The recently-added network coding support tries to set up its handler each
time a new softif is registered, which obviously fails when more that one
softif is used (and in consequence, the softif creation fails).
Fix this by moving the handler setup to batadv_recv_handler_init(), which is
called by batman-adv's __init function (and where most other packet
handlers are set up).
Would you mind changing your approach to adding a global nc_init() / nc_free()
and do the callback registration there ?
No problem. Any idea for a good name for the new function? Currently,
the init functions are named a bit inconsistently, there is
batadv_iv_init, which is called in batadv_init, and many other
batadv_*_init called in batadv_mesh_init. I'd prefer renaming all those
to batadv_*_mesh_init, but that seems like lots of avoidable changes for
a net/stable patch.
Maybe the maint patch could stay like it is, and I'll add another patch
on top for master that cleans things up?