diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2012-03-04 03:56:25 -0500 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-05-11 04:08:11 -0400 |
commit | c3e29312c8c27d403f91522711ce9a290c7571c9 (patch) | |
tree | a366ebef6e2d65ed5fdbec48e38fc3e630a9e367 /net/batman-adv/main.c | |
parent | ffa995e036bef734ea40cbbccda574d1df3a8a58 (diff) |
batman-adv: register batman ogm receive function during protocol init
The B.A.T.M.A.N. IV OGM receive function still was hard-coded although
it is a routing protocol specific function. This patch takes advantage
of the dynamic packet handler registration to remove the hard-coded
function calls.
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/main.c')
-rw-r--r-- | net/batman-adv/main.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index d19b93575d56..f80c4474127c 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c | |||
@@ -266,8 +266,6 @@ static void recv_handler_init(void) | |||
266 | for (i = 0; i < ARRAY_SIZE(recv_packet_handler); i++) | 266 | for (i = 0; i < ARRAY_SIZE(recv_packet_handler); i++) |
267 | recv_packet_handler[i] = recv_unhandled_packet; | 267 | recv_packet_handler[i] = recv_unhandled_packet; |
268 | 268 | ||
269 | /* batman originator packet */ | ||
270 | recv_packet_handler[BAT_IV_OGM] = recv_bat_ogm_packet; | ||
271 | /* batman icmp packet */ | 269 | /* batman icmp packet */ |
272 | recv_packet_handler[BAT_ICMP] = recv_icmp_packet; | 270 | recv_packet_handler[BAT_ICMP] = recv_icmp_packet; |
273 | /* unicast packet */ | 271 | /* unicast packet */ |
@@ -334,8 +332,7 @@ int bat_algo_register(struct bat_algo_ops *bat_algo_ops) | |||
334 | !bat_algo_ops->bat_primary_iface_set || | 332 | !bat_algo_ops->bat_primary_iface_set || |
335 | !bat_algo_ops->bat_ogm_update_mac || | 333 | !bat_algo_ops->bat_ogm_update_mac || |
336 | !bat_algo_ops->bat_ogm_schedule || | 334 | !bat_algo_ops->bat_ogm_schedule || |
337 | !bat_algo_ops->bat_ogm_emit || | 335 | !bat_algo_ops->bat_ogm_emit) { |
338 | !bat_algo_ops->bat_ogm_receive) { | ||
339 | pr_info("Routing algo '%s' does not implement required ops\n", | 336 | pr_info("Routing algo '%s' does not implement required ops\n", |
340 | bat_algo_ops->name); | 337 | bat_algo_ops->name); |
341 | goto out; | 338 | goto out; |