batman-adv: set up network coding packet handlers during module init
authorMatthias Schiffer <mschiffer@universe-factory.net>
Fri, 27 Sep 2013 16:03:39 +0000 (18:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2013 20:27:47 +0000 (12:27 -0800)
commitb44cfec16dac9c2aba3581c57488bad1989778f7
treed44f1bd64ff59d85cbbe6d1a42ba8b1ebae70f85
parent7e19d6db7caebd7b8ffe29ff687cc399b59790bc
batman-adv: set up network coding packet handlers during module init

commit 6c519bad7b19a2c14a075b400edabaa630330123 upstream.

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 splitting up batadv_nc_init into batadv_nc_init (which is called
only once) and batadv_nc_mesh_init (which is called for each softif); in
addition batadv_nc_free is renamed to batadv_nc_mesh_free to keep naming
consistent.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/batman-adv/main.c
net/batman-adv/network-coding.c
net/batman-adv/network-coding.h