Lines Matching refs:bat_priv
53 static void _batadv_update_route(struct batadv_priv *bat_priv, in _batadv_update_route() argument
85 batadv_dbg(BATADV_DBG_ROUTES, bat_priv, in _batadv_update_route()
87 batadv_tt_global_del_orig(bat_priv, orig_node, -1, in _batadv_update_route()
92 batadv_dbg(BATADV_DBG_ROUTES, bat_priv, in _batadv_update_route()
97 batadv_dbg(BATADV_DBG_ROUTES, bat_priv, in _batadv_update_route()
114 void batadv_update_route(struct batadv_priv *bat_priv, in batadv_update_route() argument
127 _batadv_update_route(bat_priv, orig_node, recv_if, neigh_node); in batadv_update_route()
149 bool batadv_window_protected(struct batadv_priv *bat_priv, s32 seq_num_diff, in batadv_window_protected() argument
162 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_window_protected()
216 static int batadv_recv_my_icmp_packet(struct batadv_priv *bat_priv, in batadv_recv_my_icmp_packet() argument
229 primary_if = batadv_primary_if_get_selected(bat_priv); in batadv_recv_my_icmp_packet()
234 orig_node = batadv_orig_hash_find(bat_priv, icmph->orig); in batadv_recv_my_icmp_packet()
260 batadv_tp_meter_recv(bat_priv, skb); in batadv_recv_my_icmp_packet()
278 static int batadv_recv_icmp_ttl_exceeded(struct batadv_priv *bat_priv, in batadv_recv_icmp_ttl_exceeded() argument
295 primary_if = batadv_primary_if_get_selected(bat_priv); in batadv_recv_icmp_ttl_exceeded()
300 orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->orig); in batadv_recv_icmp_ttl_exceeded()
341 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); in batadv_recv_icmp_packet() local
364 if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest)) in batadv_recv_icmp_packet()
392 if (batadv_is_my_mac(bat_priv, icmph->dst)) in batadv_recv_icmp_packet()
393 return batadv_recv_my_icmp_packet(bat_priv, skb); in batadv_recv_icmp_packet()
397 return batadv_recv_icmp_ttl_exceeded(bat_priv, skb); in batadv_recv_icmp_packet()
400 orig_node = batadv_orig_hash_find(bat_priv, icmph->dst); in batadv_recv_icmp_packet()
441 static int batadv_check_unicast_packet(struct batadv_priv *bat_priv, in batadv_check_unicast_packet() argument
461 if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest)) in batadv_check_unicast_packet()
522 batadv_find_router(struct batadv_priv *bat_priv, in batadv_find_router() argument
526 struct batadv_algo_ops *bao = bat_priv->algo_ops; in batadv_find_router()
547 if (!(recv_if == BATADV_IF_DEFAULT && atomic_read(&bat_priv->bonding))) in batadv_find_router()
659 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); in batadv_route_unicast_packet() local
676 orig_node = batadv_orig_hash_find(bat_priv, unicast_packet->dest); in batadv_route_unicast_packet()
712 batadv_inc_counter(bat_priv, BATADV_CNT_FORWARD); in batadv_route_unicast_packet()
713 batadv_add_counter(bat_priv, BATADV_CNT_FORWARD_BYTES, in batadv_route_unicast_packet()
743 batadv_reroute_unicast_packet(struct batadv_priv *bat_priv, struct sk_buff *skb, in batadv_reroute_unicast_packet() argument
753 if (batadv_is_my_client(bat_priv, dst_addr, vid)) { in batadv_reroute_unicast_packet()
754 primary_if = batadv_primary_if_get_selected(bat_priv); in batadv_reroute_unicast_packet()
758 orig_ttvn = (u8)atomic_read(&bat_priv->tt.vn); in batadv_reroute_unicast_packet()
760 orig_node = batadv_transtable_search(bat_priv, NULL, dst_addr, in batadv_reroute_unicast_packet()
786 static bool batadv_check_unicast_ttvn(struct batadv_priv *bat_priv, in batadv_check_unicast_ttvn() argument
818 if (batadv_tt_local_client_is_roaming(bat_priv, ethhdr->h_dest, vid)) { in batadv_check_unicast_ttvn()
819 if (batadv_reroute_unicast_packet(bat_priv, skb, unicast_packet, in batadv_check_unicast_ttvn()
822 bat_priv, in batadv_check_unicast_ttvn()
838 curr_ttvn = (u8)atomic_read(&bat_priv->tt.vn); in batadv_check_unicast_ttvn()
839 if (!batadv_is_my_mac(bat_priv, unicast_packet->dest)) { in batadv_check_unicast_ttvn()
840 orig_node = batadv_orig_hash_find(bat_priv, in batadv_check_unicast_ttvn()
865 if (batadv_reroute_unicast_packet(bat_priv, skb, unicast_packet, in batadv_check_unicast_ttvn()
867 batadv_dbg_ratelimited(BATADV_DBG_TT, bat_priv, in batadv_check_unicast_ttvn()
878 if (!batadv_is_my_client(bat_priv, ethhdr->h_dest, vid)) in batadv_check_unicast_ttvn()
884 primary_if = batadv_primary_if_get_selected(bat_priv); in batadv_check_unicast_ttvn()
912 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); in batadv_recv_unhandled_unicast_packet() local
915 check = batadv_check_unicast_packet(bat_priv, skb, hdr_size); in batadv_recv_unhandled_unicast_packet()
921 if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) in batadv_recv_unhandled_unicast_packet()
941 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); in batadv_recv_unicast_packet() local
958 check = batadv_check_unicast_packet(bat_priv, skb, hdr_size); in batadv_recv_unicast_packet()
964 batadv_nc_skb_store_sniffed_unicast(bat_priv, skb); in batadv_recv_unicast_packet()
968 if (!batadv_check_unicast_ttvn(bat_priv, skb, hdr_size)) in batadv_recv_unicast_packet()
974 if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) { in batadv_recv_unicast_packet()
979 orig_node_gw = batadv_orig_hash_find(bat_priv, orig_addr_gw); in batadv_recv_unicast_packet()
985 batadv_dbg(BATADV_DBG_BLA, bat_priv, in batadv_recv_unicast_packet()
996 batadv_dat_inc_counter(bat_priv, subtype); in batadv_recv_unicast_packet()
1006 orig_node = batadv_orig_hash_find(bat_priv, in batadv_recv_unicast_packet()
1011 if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb, in batadv_recv_unicast_packet()
1014 if (batadv_dat_snoop_incoming_arp_reply(bat_priv, skb, in batadv_recv_unicast_packet()
1018 batadv_dat_snoop_incoming_dhcp_ack(bat_priv, skb, hdr_size); in batadv_recv_unicast_packet()
1050 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); in batadv_recv_unicast_tvlv() local
1057 if (batadv_check_unicast_packet(bat_priv, skb, hdr_size) < 0) in batadv_recv_unicast_tvlv()
1076 ret = batadv_tvlv_containers_process(bat_priv, false, NULL, in batadv_recv_unicast_tvlv()
1107 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); in batadv_recv_frag_packet() local
1112 if (batadv_check_unicast_packet(bat_priv, skb, in batadv_recv_frag_packet()
1117 orig_node_src = batadv_orig_hash_find(bat_priv, frag_packet->orig); in batadv_recv_frag_packet()
1124 if (!batadv_is_my_mac(bat_priv, frag_packet->dest) && in batadv_recv_frag_packet()
1132 batadv_inc_counter(bat_priv, BATADV_CNT_FRAG_RX); in batadv_recv_frag_packet()
1133 batadv_add_counter(bat_priv, BATADV_CNT_FRAG_RX_BYTES, skb->len); in batadv_recv_frag_packet()
1169 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); in batadv_recv_bcast_packet() local
1193 if (batadv_is_my_mac(bat_priv, ethhdr->h_source)) in batadv_recv_bcast_packet()
1199 if (batadv_is_my_mac(bat_priv, bcast_packet->orig)) in batadv_recv_bcast_packet()
1205 orig_node = batadv_orig_hash_find(bat_priv, bcast_packet->orig); in batadv_recv_bcast_packet()
1221 if (batadv_window_protected(bat_priv, seq_diff, in batadv_recv_bcast_packet()
1229 if (batadv_bit_get_packet(bat_priv, orig_node->bcast_bits, seq_diff, 1)) in batadv_recv_bcast_packet()
1235 if (batadv_bla_check_bcast_duplist(bat_priv, skb)) in batadv_recv_bcast_packet()
1241 ret = batadv_forw_bcast_packet(bat_priv, skb, 0, false); in batadv_recv_bcast_packet()
1251 if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb, hdr_size)) in batadv_recv_bcast_packet()
1253 if (batadv_dat_snoop_incoming_arp_reply(bat_priv, skb, hdr_size)) in batadv_recv_bcast_packet()
1256 batadv_dat_snoop_incoming_dhcp_ack(bat_priv, skb, hdr_size); in batadv_recv_bcast_packet()