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>
This commit is contained in:

committed by
Antonio Quartulli

parent
ffa995e036
commit
c3e29312c8
@@ -266,8 +266,6 @@ static void recv_handler_init(void)
|
||||
for (i = 0; i < ARRAY_SIZE(recv_packet_handler); i++)
|
||||
recv_packet_handler[i] = recv_unhandled_packet;
|
||||
|
||||
/* batman originator packet */
|
||||
recv_packet_handler[BAT_IV_OGM] = recv_bat_ogm_packet;
|
||||
/* batman icmp packet */
|
||||
recv_packet_handler[BAT_ICMP] = recv_icmp_packet;
|
||||
/* unicast packet */
|
||||
@@ -334,8 +332,7 @@ int bat_algo_register(struct bat_algo_ops *bat_algo_ops)
|
||||
!bat_algo_ops->bat_primary_iface_set ||
|
||||
!bat_algo_ops->bat_ogm_update_mac ||
|
||||
!bat_algo_ops->bat_ogm_schedule ||
|
||||
!bat_algo_ops->bat_ogm_emit ||
|
||||
!bat_algo_ops->bat_ogm_receive) {
|
||||
!bat_algo_ops->bat_ogm_emit) {
|
||||
pr_info("Routing algo '%s' does not implement required ops\n",
|
||||
bat_algo_ops->name);
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user