@@ -298,7 +298,7 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
298298
299299 /* answer echo request (ping) */
300300 /* get routing information */
301- orig_node = orig_hash_find (bat_priv , icmp_packet -> orig );
301+ orig_node = batadv_orig_hash_find (bat_priv , icmp_packet -> orig );
302302 if (!orig_node )
303303 goto out ;
304304
@@ -353,7 +353,7 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
353353 goto out ;
354354
355355 /* get routing information */
356- orig_node = orig_hash_find (bat_priv , icmp_packet -> orig );
356+ orig_node = batadv_orig_hash_find (bat_priv , icmp_packet -> orig );
357357 if (!orig_node )
358358 goto out ;
359359
@@ -437,7 +437,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
437437 return recv_icmp_ttl_exceeded (bat_priv , skb );
438438
439439 /* get routing information */
440- orig_node = orig_hash_find (bat_priv , icmp_packet -> dst );
440+ orig_node = batadv_orig_hash_find (bat_priv , icmp_packet -> dst );
441441 if (!orig_node )
442442 goto out ;
443443
@@ -684,7 +684,7 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
684684 if (batadv_bla_is_backbone_gw_orig (bat_priv , roam_adv_packet -> src ))
685685 goto out ;
686686
687- orig_node = orig_hash_find (bat_priv , roam_adv_packet -> src );
687+ orig_node = batadv_orig_hash_find (bat_priv , roam_adv_packet -> src );
688688 if (!orig_node )
689689 goto out ;
690690
@@ -721,6 +721,7 @@ struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
721721 struct neigh_node * router ;
722722 static uint8_t zero_mac [ETH_ALEN ] = {0 , 0 , 0 , 0 , 0 , 0 };
723723 int bonding_enabled ;
724+ uint8_t * primary_addr ;
724725
725726 if (!orig_node )
726727 return NULL ;
@@ -743,20 +744,22 @@ struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
743744 if ((!recv_if ) && (!bonding_enabled ))
744745 goto return_router ;
745746
747+ primary_addr = router_orig -> primary_addr ;
748+
746749 /* if we have something in the primary_addr, we can search
747750 * for a potential bonding candidate.
748751 */
749- if (compare_eth (router_orig -> primary_addr , zero_mac ))
752+ if (compare_eth (primary_addr , zero_mac ))
750753 goto return_router ;
751754
752755 /* find the orig_node which has the primary interface. might
753756 * even be the same as our router_orig in many cases
754757 */
755- if (compare_eth (router_orig -> primary_addr , router_orig -> orig )) {
758+ if (compare_eth (primary_addr , router_orig -> orig )) {
756759 primary_orig_node = router_orig ;
757760 } else {
758- primary_orig_node = orig_hash_find (bat_priv ,
759- router_orig -> primary_addr );
761+ primary_orig_node = batadv_orig_hash_find (bat_priv ,
762+ primary_addr );
760763 if (!primary_orig_node )
761764 goto return_router ;
762765
@@ -839,7 +842,7 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
839842 }
840843
841844 /* get routing information */
842- orig_node = orig_hash_find (bat_priv , unicast_packet -> dest );
845+ orig_node = batadv_orig_hash_find (bat_priv , unicast_packet -> dest );
843846
844847 if (!orig_node )
845848 goto out ;
@@ -922,7 +925,8 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv,
922925 tt_poss_change = bat_priv -> tt_poss_change ;
923926 curr_ttvn = (uint8_t )atomic_read (& bat_priv -> ttvn );
924927 } else {
925- orig_node = orig_hash_find (bat_priv , unicast_packet -> dest );
928+ orig_node = batadv_orig_hash_find (bat_priv ,
929+ unicast_packet -> dest );
926930
927931 if (!orig_node )
928932 return 0 ;
@@ -1078,7 +1082,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
10781082 if (bcast_packet -> header .ttl < 2 )
10791083 goto out ;
10801084
1081- orig_node = orig_hash_find (bat_priv , bcast_packet -> orig );
1085+ orig_node = batadv_orig_hash_find (bat_priv , bcast_packet -> orig );
10821086
10831087 if (!orig_node )
10841088 goto out ;
0 commit comments