Lines Matching full:if
16 * along with this program; if not, write to the Free Software
72 if ((curr_router) && (!neigh_node)) { in _update_route()
79 } else if ((!curr_router) && (neigh_node)) { in _update_route()
85 } else if (neigh_node && curr_router) { in _update_route()
93 if (curr_router) in _update_route()
97 if (neigh_node && !atomic_inc_not_zero(&neigh_node->refcount)) in _update_route()
105 if (curr_router) in _update_route()
114 if (!orig_node) in update_route()
119 if (router != neigh_node) in update_route()
123 if (router) in update_route()
132 if (list_empty(&neigh_node->bonding_list)) in bonding_candidate_del()
153 /* only consider if it has the same primary address ... */ in bonding_candidate_add()
154 if (!compare_eth(orig_node->orig, in bonding_candidate_add()
159 if (!router) in bonding_candidate_add()
163 if (neigh_node->tq_avg < router->tq_avg - BONDING_TQ_THRESHOLD) in bonding_candidate_add()
167 * check if we have another candidate with the same mac address or in bonding_candidate_add()
168 * interface. If we do, we won't select this candidate because of in bonding_candidate_add()
174 if (tmp_neigh_node == neigh_node) in bonding_candidate_add()
177 /* we only care if the other candidate is even in bonding_candidate_add()
179 if (list_empty(&tmp_neigh_node->bonding_list)) in bonding_candidate_add()
182 if ((neigh_node->if_incoming == tmp_neigh_node->if_incoming) || in bonding_candidate_add()
189 /* don't care further if it is an interference candidate */ in bonding_candidate_add()
190 if (interference_candidate) in bonding_candidate_add()
194 if (!list_empty(&neigh_node->bonding_list)) in bonding_candidate_add()
197 if (!atomic_inc_not_zero(&neigh_node->refcount)) in bonding_candidate_add()
210 if (router) in bonding_candidate_add()
219 if (!(batman_ogm_packet->flags & PRIMARIES_FIRST_HOP)) in bonding_save_primary()
227 * 0 if the packet is to be accepted
228 * 1 if the packet is to be ignored.
233 if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) in window_protected()
235 if (time_after(jiffies, *last_reset + in window_protected()
253 /* drop packet if it has not necessary minimum size */ in recv_bat_ogm_packet()
254 if (unlikely(!pskb_may_pull(skb, BATMAN_OGM_LEN))) in recv_bat_ogm_packet()
260 if (!is_broadcast_ether_addr(ethhdr->h_dest)) in recv_bat_ogm_packet()
264 if (is_broadcast_ether_addr(ethhdr->h_source)) in recv_bat_ogm_packet()
267 /* create a copy of the skb, if needed, to modify it. */ in recv_bat_ogm_packet()
268 if (skb_cow(skb, 0) < 0) in recv_bat_ogm_packet()
272 if (skb_linearize(skb) < 0) in recv_bat_ogm_packet()
295 if (icmp_packet->msg_type != ECHO_REQUEST) { in recv_my_icmp_packet()
301 if (!primary_if) in recv_my_icmp_packet()
307 if (!orig_node) in recv_my_icmp_packet()
311 if (!router) in recv_my_icmp_packet()
314 /* create a copy of the skb, if needed, to modify it. */ in recv_my_icmp_packet()
315 if (skb_cow(skb, sizeof(struct ethhdr)) < 0) in recv_my_icmp_packet()
329 if (primary_if) in recv_my_icmp_packet()
331 if (router) in recv_my_icmp_packet()
333 if (orig_node) in recv_my_icmp_packet()
349 /* send TTL exceeded if packet is an echo request (traceroute) */ in recv_icmp_ttl_exceeded()
350 if (icmp_packet->msg_type != ECHO_REQUEST) { in recv_icmp_ttl_exceeded()
358 if (!primary_if) in recv_icmp_ttl_exceeded()
363 if (!orig_node) in recv_icmp_ttl_exceeded()
367 if (!router) in recv_icmp_ttl_exceeded()
370 /* create a copy of the skb, if needed, to modify it. */ in recv_icmp_ttl_exceeded()
371 if (skb_cow(skb, sizeof(struct ethhdr)) < 0) in recv_icmp_ttl_exceeded()
385 if (primary_if) in recv_icmp_ttl_exceeded()
387 if (router) in recv_icmp_ttl_exceeded()
389 if (orig_node) in recv_icmp_ttl_exceeded()
406 * we truncate all incoming icmp packets if they don't match our size in recv_icmp_packet()
408 if (skb->len >= sizeof(struct icmp_packet_rr)) in recv_icmp_packet()
411 /* drop packet if it has not necessary minimum size */ in recv_icmp_packet()
412 if (unlikely(!pskb_may_pull(skb, hdr_size))) in recv_icmp_packet()
418 if (is_broadcast_ether_addr(ethhdr->h_dest)) in recv_icmp_packet()
422 if (is_broadcast_ether_addr(ethhdr->h_source)) in recv_icmp_packet()
426 if (!is_my_mac(ethhdr->h_dest)) in recv_icmp_packet()
431 /* add record route information if not full */ in recv_icmp_packet()
432 if ((hdr_size == sizeof(struct icmp_packet_rr)) && in recv_icmp_packet()
440 if (is_my_mac(icmp_packet->dst)) in recv_icmp_packet()
444 if (icmp_packet->ttl < 2) in recv_icmp_packet()
449 if (!orig_node) in recv_icmp_packet()
453 if (!router) in recv_icmp_packet()
456 /* create a copy of the skb, if needed, to modify it. */ in recv_icmp_packet()
457 if (skb_cow(skb, sizeof(struct ethhdr)) < 0) in recv_icmp_packet()
470 if (router) in recv_icmp_packet()
472 if (orig_node) in recv_icmp_packet()
491 if (!first_candidate) in find_bond_router()
495 if (tmp_neigh_node->if_incoming == recv_if) in find_bond_router()
498 if (!atomic_inc_not_zero(&tmp_neigh_node->refcount)) in find_bond_router()
505 /* use the first candidate if nothing was found. */ in find_bond_router()
506 if (!router && first_candidate && in find_bond_router()
510 if (!router) in find_bond_router()
542 if (!first_candidate) in find_ifalter_router()
546 if (tmp_neigh_node->if_incoming == recv_if) in find_ifalter_router()
549 if (!atomic_inc_not_zero(&tmp_neigh_node->refcount)) in find_ifalter_router()
552 /* if we don't have a router yet in find_ifalter_router()
554 if ((!router) || in find_ifalter_router()
558 if (router) in find_ifalter_router()
568 /* use the first candidate if nothing was found. */ in find_ifalter_router()
569 if (!router && first_candidate && in find_ifalter_router()
584 /* drop packet if it has not necessary minimum size */ in recv_tt_query()
585 if (unlikely(!pskb_may_pull(skb, sizeof(struct tt_query_packet)))) in recv_tt_query()
589 if (skb_cow(skb, sizeof(struct tt_query_packet)) < 0) in recv_tt_query()
595 if (is_broadcast_ether_addr(ethhdr->h_dest)) in recv_tt_query()
599 if (is_broadcast_ether_addr(ethhdr->h_source)) in recv_tt_query()
608 /* If we cannot provide an answer the tt_request is in recv_tt_query()
610 if (!send_tt_response(bat_priv, tt_query)) { in recv_tt_query()
620 if (is_my_mac(tt_query->dst)) { in recv_tt_query()
623 if (skb_linearize(skb) < 0) in recv_tt_query()
629 if (unlikely(skb_headlen(skb) < in recv_tt_query()
657 /* drop packet if it has not necessary minimum size */ in recv_roam_adv()
658 if (unlikely(!pskb_may_pull(skb, sizeof(struct roam_adv_packet)))) in recv_roam_adv()
664 if (is_broadcast_ether_addr(ethhdr->h_dest)) in recv_roam_adv()
668 if (is_broadcast_ether_addr(ethhdr->h_source)) in recv_roam_adv()
673 if (!is_my_mac(roam_adv_packet->dst)) in recv_roam_adv()
677 if (!orig_node) in recv_roam_adv()
699 * bonding if possible. increases the found neighbors
711 if (!orig_node) in find_router()
715 if (!router) in find_router()
725 if (!router_orig) in find_router()
728 if ((!recv_if) && (!bonding_enabled)) in find_router()
731 /* if we have something in the primary_addr, we can search in find_router()
733 if (compare_eth(router_orig->primary_addr, zero_mac)) in find_router()
739 if (compare_eth(router_orig->primary_addr, router_orig->orig)) { in find_router()
744 if (!primary_orig_node) in find_router()
752 if (atomic_read(&primary_orig_node->bond_candidates) < 2) in find_router()
761 if (bonding_enabled) in find_router()
767 if (router && router->if_incoming->if_status != IF_ACTIVE) in find_router()
775 if (router) in find_router()
784 /* drop packet if it has not necessary minimum size */ in check_unicast_packet()
785 if (unlikely(!pskb_may_pull(skb, hdr_size))) in check_unicast_packet()
791 if (is_broadcast_ether_addr(ethhdr->h_dest)) in check_unicast_packet()
795 if (is_broadcast_ether_addr(ethhdr->h_source)) in check_unicast_packet()
799 if (!is_my_mac(ethhdr->h_dest)) in check_unicast_packet()
818 if (unicast_packet->ttl < 2) { in route_unicast_packet()
828 if (!orig_node) in route_unicast_packet()
831 /* find_router() increases neigh_nodes refcount if found. */ in route_unicast_packet()
834 if (!neigh_node) in route_unicast_packet()
837 /* create a copy of the skb, if needed, to modify it. */ in route_unicast_packet()
838 if (skb_cow(skb, sizeof(struct ethhdr)) < 0) in route_unicast_packet()
843 if (unicast_packet->packet_type == BAT_UNICAST && in route_unicast_packet()
851 if (unicast_packet->packet_type == BAT_UNICAST_FRAG && in route_unicast_packet()
856 if (ret == NET_RX_DROP) in route_unicast_packet()
860 if (!new_skb) { in route_unicast_packet()
877 if (neigh_node) in route_unicast_packet()
879 if (orig_node) in route_unicast_packet()
894 if (skb_cow(skb, sizeof(struct unicast_packet)) < 0) in check_unicast_ttvn()
899 if (is_my_mac(unicast_packet->dest)) { in check_unicast_ttvn()
905 if (!orig_node) in check_unicast_ttvn()
914 if (seq_before(unicast_packet->ttvn, curr_ttvn) || tt_poss_change) { in check_unicast_ttvn()
916 if (skb_linearize(skb) < 0) in check_unicast_ttvn()
923 if (!orig_node) { in check_unicast_ttvn()
924 if (!is_my_client(bat_priv, ethhdr->h_dest)) in check_unicast_ttvn()
927 if (!primary_if) in check_unicast_ttvn()
956 if (check_unicast_packet(skb, hdr_size) < 0) in recv_unicast_packet()
959 if (!check_unicast_ttvn(bat_priv, skb)) in recv_unicast_packet()
965 if (is_my_mac(unicast_packet->dest)) { in recv_unicast_packet()
981 if (check_unicast_packet(skb, hdr_size) < 0) in recv_ucast_frag_packet()
984 if (!check_unicast_ttvn(bat_priv, skb)) in recv_ucast_frag_packet()
990 if (is_my_mac(unicast_packet->dest)) { in recv_ucast_frag_packet()
994 if (ret == NET_RX_DROP) in recv_ucast_frag_packet()
998 if (!new_skb) in recv_ucast_frag_packet()
1020 /* drop packet if it has not necessary minimum size */ in recv_bcast_packet()
1021 if (unlikely(!pskb_may_pull(skb, hdr_size))) in recv_bcast_packet()
1027 if (!is_broadcast_ether_addr(ethhdr->h_dest)) in recv_bcast_packet()
1031 if (is_broadcast_ether_addr(ethhdr->h_source)) in recv_bcast_packet()
1035 if (is_my_mac(ethhdr->h_source)) in recv_bcast_packet()
1041 if (is_my_mac(bcast_packet->orig)) in recv_bcast_packet()
1044 if (bcast_packet->ttl < 2) in recv_bcast_packet()
1049 if (!orig_node) in recv_bcast_packet()
1055 if (get_bit_status(orig_node->bcast_bits, orig_node->last_bcast_seqno, in recv_bcast_packet()
1062 if (window_protected(bat_priv, seq_diff, in recv_bcast_packet()
1067 * if required. */ in recv_bcast_packet()
1068 if (bit_get_packet(bat_priv, orig_node->bcast_bits, seq_diff, 1)) in recv_bcast_packet()
1084 if (orig_node) in recv_bcast_packet()
1097 if (skb_linearize(skb) < 0) in recv_vis_packet()
1100 if (unlikely(!pskb_may_pull(skb, hdr_size))) in recv_vis_packet()
1107 if (!is_my_mac(ethhdr->h_dest)) in recv_vis_packet()
1111 if (is_my_mac(vis_packet->vis_orig)) in recv_vis_packet()
1114 if (is_my_mac(vis_packet->sender_orig)) in recv_vis_packet()