diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-06-05 16:31:30 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-07-01 16:47:21 -0400 |
commit | 96412690116afcc1b2705615b5a7c8dc6c5e905f (patch) | |
tree | 0eb2a1a557e2997175b27f3ab925bbdc29ece54d /net/batman-adv/routing.c | |
parent | b4d66b877bc21ce907938bfd027dfe016617fac0 (diff) |
batman-adv: Prefix packet structs with batadv_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/routing.c')
-rw-r--r-- | net/batman-adv/routing.c | 88 |
1 files changed, 46 insertions, 42 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 86d444a87bde..e15790761105 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -217,7 +217,7 @@ out: | |||
217 | void | 217 | void |
218 | batadv_bonding_save_primary(const struct orig_node *orig_node, | 218 | batadv_bonding_save_primary(const struct orig_node *orig_node, |
219 | struct orig_node *orig_neigh_node, | 219 | struct orig_node *orig_neigh_node, |
220 | const struct batman_ogm_packet *batman_ogm_packet) | 220 | const struct batadv_ogm_packet *batman_ogm_packet) |
221 | { | 221 | { |
222 | if (!(batman_ogm_packet->flags & BATADV_PRIMARIES_FIRST_HOP)) | 222 | if (!(batman_ogm_packet->flags & BATADV_PRIMARIES_FIRST_HOP)) |
223 | return; | 223 | return; |
@@ -284,10 +284,10 @@ static int batadv_recv_my_icmp_packet(struct bat_priv *bat_priv, | |||
284 | struct hard_iface *primary_if = NULL; | 284 | struct hard_iface *primary_if = NULL; |
285 | struct orig_node *orig_node = NULL; | 285 | struct orig_node *orig_node = NULL; |
286 | struct neigh_node *router = NULL; | 286 | struct neigh_node *router = NULL; |
287 | struct icmp_packet_rr *icmp_packet; | 287 | struct batadv_icmp_packet_rr *icmp_packet; |
288 | int ret = NET_RX_DROP; | 288 | int ret = NET_RX_DROP; |
289 | 289 | ||
290 | icmp_packet = (struct icmp_packet_rr *)skb->data; | 290 | icmp_packet = (struct batadv_icmp_packet_rr *)skb->data; |
291 | 291 | ||
292 | /* add data to device queue */ | 292 | /* add data to device queue */ |
293 | if (icmp_packet->msg_type != BATADV_ECHO_REQUEST) { | 293 | if (icmp_packet->msg_type != BATADV_ECHO_REQUEST) { |
@@ -313,7 +313,7 @@ static int batadv_recv_my_icmp_packet(struct bat_priv *bat_priv, | |||
313 | if (skb_cow(skb, ETH_HLEN) < 0) | 313 | if (skb_cow(skb, ETH_HLEN) < 0) |
314 | goto out; | 314 | goto out; |
315 | 315 | ||
316 | icmp_packet = (struct icmp_packet_rr *)skb->data; | 316 | icmp_packet = (struct batadv_icmp_packet_rr *)skb->data; |
317 | 317 | ||
318 | memcpy(icmp_packet->dst, icmp_packet->orig, ETH_ALEN); | 318 | memcpy(icmp_packet->dst, icmp_packet->orig, ETH_ALEN); |
319 | memcpy(icmp_packet->orig, primary_if->net_dev->dev_addr, ETH_ALEN); | 319 | memcpy(icmp_packet->orig, primary_if->net_dev->dev_addr, ETH_ALEN); |
@@ -339,10 +339,10 @@ static int batadv_recv_icmp_ttl_exceeded(struct bat_priv *bat_priv, | |||
339 | struct hard_iface *primary_if = NULL; | 339 | struct hard_iface *primary_if = NULL; |
340 | struct orig_node *orig_node = NULL; | 340 | struct orig_node *orig_node = NULL; |
341 | struct neigh_node *router = NULL; | 341 | struct neigh_node *router = NULL; |
342 | struct icmp_packet *icmp_packet; | 342 | struct batadv_icmp_packet *icmp_packet; |
343 | int ret = NET_RX_DROP; | 343 | int ret = NET_RX_DROP; |
344 | 344 | ||
345 | icmp_packet = (struct icmp_packet *)skb->data; | 345 | icmp_packet = (struct batadv_icmp_packet *)skb->data; |
346 | 346 | ||
347 | /* send TTL exceeded if packet is an echo request (traceroute) */ | 347 | /* send TTL exceeded if packet is an echo request (traceroute) */ |
348 | if (icmp_packet->msg_type != BATADV_ECHO_REQUEST) { | 348 | if (icmp_packet->msg_type != BATADV_ECHO_REQUEST) { |
@@ -368,7 +368,7 @@ static int batadv_recv_icmp_ttl_exceeded(struct bat_priv *bat_priv, | |||
368 | if (skb_cow(skb, ETH_HLEN) < 0) | 368 | if (skb_cow(skb, ETH_HLEN) < 0) |
369 | goto out; | 369 | goto out; |
370 | 370 | ||
371 | icmp_packet = (struct icmp_packet *)skb->data; | 371 | icmp_packet = (struct batadv_icmp_packet *)skb->data; |
372 | 372 | ||
373 | memcpy(icmp_packet->dst, icmp_packet->orig, ETH_ALEN); | 373 | memcpy(icmp_packet->dst, icmp_packet->orig, ETH_ALEN); |
374 | memcpy(icmp_packet->orig, primary_if->net_dev->dev_addr, ETH_ALEN); | 374 | memcpy(icmp_packet->orig, primary_if->net_dev->dev_addr, ETH_ALEN); |
@@ -392,16 +392,16 @@ out: | |||
392 | int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if) | 392 | int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if) |
393 | { | 393 | { |
394 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 394 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
395 | struct icmp_packet_rr *icmp_packet; | 395 | struct batadv_icmp_packet_rr *icmp_packet; |
396 | struct ethhdr *ethhdr; | 396 | struct ethhdr *ethhdr; |
397 | struct orig_node *orig_node = NULL; | 397 | struct orig_node *orig_node = NULL; |
398 | struct neigh_node *router = NULL; | 398 | struct neigh_node *router = NULL; |
399 | int hdr_size = sizeof(struct icmp_packet); | 399 | int hdr_size = sizeof(struct batadv_icmp_packet); |
400 | int ret = NET_RX_DROP; | 400 | int ret = NET_RX_DROP; |
401 | 401 | ||
402 | /* we truncate all incoming icmp packets if they don't match our size */ | 402 | /* we truncate all incoming icmp packets if they don't match our size */ |
403 | if (skb->len >= sizeof(struct icmp_packet_rr)) | 403 | if (skb->len >= sizeof(struct batadv_icmp_packet_rr)) |
404 | hdr_size = sizeof(struct icmp_packet_rr); | 404 | hdr_size = sizeof(struct batadv_icmp_packet_rr); |
405 | 405 | ||
406 | /* drop packet if it has not necessary minimum size */ | 406 | /* drop packet if it has not necessary minimum size */ |
407 | if (unlikely(!pskb_may_pull(skb, hdr_size))) | 407 | if (unlikely(!pskb_may_pull(skb, hdr_size))) |
@@ -421,10 +421,10 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
421 | if (!batadv_is_my_mac(ethhdr->h_dest)) | 421 | if (!batadv_is_my_mac(ethhdr->h_dest)) |
422 | goto out; | 422 | goto out; |
423 | 423 | ||
424 | icmp_packet = (struct icmp_packet_rr *)skb->data; | 424 | icmp_packet = (struct batadv_icmp_packet_rr *)skb->data; |
425 | 425 | ||
426 | /* add record route information if not full */ | 426 | /* add record route information if not full */ |
427 | if ((hdr_size == sizeof(struct icmp_packet_rr)) && | 427 | if ((hdr_size == sizeof(struct batadv_icmp_packet_rr)) && |
428 | (icmp_packet->rr_cur < BATADV_RR_LEN)) { | 428 | (icmp_packet->rr_cur < BATADV_RR_LEN)) { |
429 | memcpy(&(icmp_packet->rr[icmp_packet->rr_cur]), | 429 | memcpy(&(icmp_packet->rr[icmp_packet->rr_cur]), |
430 | ethhdr->h_dest, ETH_ALEN); | 430 | ethhdr->h_dest, ETH_ALEN); |
@@ -452,7 +452,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
452 | if (skb_cow(skb, ETH_HLEN) < 0) | 452 | if (skb_cow(skb, ETH_HLEN) < 0) |
453 | goto out; | 453 | goto out; |
454 | 454 | ||
455 | icmp_packet = (struct icmp_packet_rr *)skb->data; | 455 | icmp_packet = (struct batadv_icmp_packet_rr *)skb->data; |
456 | 456 | ||
457 | /* decrement ttl */ | 457 | /* decrement ttl */ |
458 | icmp_packet->header.ttl--; | 458 | icmp_packet->header.ttl--; |
@@ -580,17 +580,19 @@ batadv_find_ifalter_router(struct orig_node *primary_orig, | |||
580 | int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if) | 580 | int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if) |
581 | { | 581 | { |
582 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 582 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
583 | struct tt_query_packet *tt_query; | 583 | struct batadv_tt_query_packet *tt_query; |
584 | uint16_t tt_size; | 584 | uint16_t tt_size; |
585 | struct ethhdr *ethhdr; | 585 | struct ethhdr *ethhdr; |
586 | char tt_flag; | 586 | char tt_flag; |
587 | size_t packet_size; | ||
587 | 588 | ||
588 | /* drop packet if it has not necessary minimum size */ | 589 | /* drop packet if it has not necessary minimum size */ |
589 | if (unlikely(!pskb_may_pull(skb, sizeof(struct tt_query_packet)))) | 590 | if (unlikely(!pskb_may_pull(skb, |
591 | sizeof(struct batadv_tt_query_packet)))) | ||
590 | goto out; | 592 | goto out; |
591 | 593 | ||
592 | /* I could need to modify it */ | 594 | /* I could need to modify it */ |
593 | if (skb_cow(skb, sizeof(struct tt_query_packet)) < 0) | 595 | if (skb_cow(skb, sizeof(struct batadv_tt_query_packet)) < 0) |
594 | goto out; | 596 | goto out; |
595 | 597 | ||
596 | ethhdr = (struct ethhdr *)skb_mac_header(skb); | 598 | ethhdr = (struct ethhdr *)skb_mac_header(skb); |
@@ -603,7 +605,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if) | |||
603 | if (is_broadcast_ether_addr(ethhdr->h_source)) | 605 | if (is_broadcast_ether_addr(ethhdr->h_source)) |
604 | goto out; | 606 | goto out; |
605 | 607 | ||
606 | tt_query = (struct tt_query_packet *)skb->data; | 608 | tt_query = (struct batadv_tt_query_packet *)skb->data; |
607 | 609 | ||
608 | switch (tt_query->flags & BATADV_TT_QUERY_TYPE_MASK) { | 610 | switch (tt_query->flags & BATADV_TT_QUERY_TYPE_MASK) { |
609 | case BATADV_TT_REQUEST: | 611 | case BATADV_TT_REQUEST: |
@@ -635,13 +637,14 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if) | |||
635 | if (skb_linearize(skb) < 0) | 637 | if (skb_linearize(skb) < 0) |
636 | goto out; | 638 | goto out; |
637 | /* skb_linearize() possibly changed skb->data */ | 639 | /* skb_linearize() possibly changed skb->data */ |
638 | tt_query = (struct tt_query_packet *)skb->data; | 640 | tt_query = (struct batadv_tt_query_packet *)skb->data; |
639 | 641 | ||
640 | tt_size = batadv_tt_len(ntohs(tt_query->tt_data)); | 642 | tt_size = batadv_tt_len(ntohs(tt_query->tt_data)); |
641 | 643 | ||
642 | /* Ensure we have all the claimed data */ | 644 | /* Ensure we have all the claimed data */ |
643 | if (unlikely(skb_headlen(skb) < | 645 | packet_size = sizeof(struct batadv_tt_query_packet); |
644 | sizeof(struct tt_query_packet) + tt_size)) | 646 | packet_size += tt_size; |
647 | if (unlikely(skb_headlen(skb) < packet_size)) | ||
645 | goto out; | 648 | goto out; |
646 | 649 | ||
647 | batadv_handle_tt_response(bat_priv, tt_query); | 650 | batadv_handle_tt_response(bat_priv, tt_query); |
@@ -667,12 +670,13 @@ out: | |||
667 | int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if) | 670 | int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if) |
668 | { | 671 | { |
669 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 672 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
670 | struct roam_adv_packet *roam_adv_packet; | 673 | struct batadv_roam_adv_packet *roam_adv_packet; |
671 | struct orig_node *orig_node; | 674 | struct orig_node *orig_node; |
672 | struct ethhdr *ethhdr; | 675 | struct ethhdr *ethhdr; |
673 | 676 | ||
674 | /* drop packet if it has not necessary minimum size */ | 677 | /* drop packet if it has not necessary minimum size */ |
675 | if (unlikely(!pskb_may_pull(skb, sizeof(struct roam_adv_packet)))) | 678 | if (unlikely(!pskb_may_pull(skb, |
679 | sizeof(struct batadv_roam_adv_packet)))) | ||
676 | goto out; | 680 | goto out; |
677 | 681 | ||
678 | ethhdr = (struct ethhdr *)skb_mac_header(skb); | 682 | ethhdr = (struct ethhdr *)skb_mac_header(skb); |
@@ -687,7 +691,7 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if) | |||
687 | 691 | ||
688 | batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_RX); | 692 | batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_RX); |
689 | 693 | ||
690 | roam_adv_packet = (struct roam_adv_packet *)skb->data; | 694 | roam_adv_packet = (struct batadv_roam_adv_packet *)skb->data; |
691 | 695 | ||
692 | if (!batadv_is_my_mac(roam_adv_packet->dst)) | 696 | if (!batadv_is_my_mac(roam_adv_packet->dst)) |
693 | return batadv_route_unicast_packet(skb, recv_if); | 697 | return batadv_route_unicast_packet(skb, recv_if); |
@@ -843,12 +847,12 @@ static int batadv_route_unicast_packet(struct sk_buff *skb, | |||
843 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 847 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
844 | struct orig_node *orig_node = NULL; | 848 | struct orig_node *orig_node = NULL; |
845 | struct neigh_node *neigh_node = NULL; | 849 | struct neigh_node *neigh_node = NULL; |
846 | struct unicast_packet *unicast_packet; | 850 | struct batadv_unicast_packet *unicast_packet; |
847 | struct ethhdr *ethhdr = (struct ethhdr *)skb_mac_header(skb); | 851 | struct ethhdr *ethhdr = (struct ethhdr *)skb_mac_header(skb); |
848 | int ret = NET_RX_DROP; | 852 | int ret = NET_RX_DROP; |
849 | struct sk_buff *new_skb; | 853 | struct sk_buff *new_skb; |
850 | 854 | ||
851 | unicast_packet = (struct unicast_packet *)skb->data; | 855 | unicast_packet = (struct batadv_unicast_packet *)skb->data; |
852 | 856 | ||
853 | /* TTL exceeded */ | 857 | /* TTL exceeded */ |
854 | if (unicast_packet->header.ttl < 2) { | 858 | if (unicast_packet->header.ttl < 2) { |
@@ -873,7 +877,7 @@ static int batadv_route_unicast_packet(struct sk_buff *skb, | |||
873 | if (skb_cow(skb, ETH_HLEN) < 0) | 877 | if (skb_cow(skb, ETH_HLEN) < 0) |
874 | goto out; | 878 | goto out; |
875 | 879 | ||
876 | unicast_packet = (struct unicast_packet *)skb->data; | 880 | unicast_packet = (struct batadv_unicast_packet *)skb->data; |
877 | 881 | ||
878 | if (unicast_packet->header.packet_type == BATADV_UNICAST && | 882 | if (unicast_packet->header.packet_type == BATADV_UNICAST && |
879 | atomic_read(&bat_priv->fragmentation) && | 883 | atomic_read(&bat_priv->fragmentation) && |
@@ -900,7 +904,7 @@ static int batadv_route_unicast_packet(struct sk_buff *skb, | |||
900 | } | 904 | } |
901 | 905 | ||
902 | skb = new_skb; | 906 | skb = new_skb; |
903 | unicast_packet = (struct unicast_packet *)skb->data; | 907 | unicast_packet = (struct batadv_unicast_packet *)skb->data; |
904 | } | 908 | } |
905 | 909 | ||
906 | /* decrement ttl */ | 910 | /* decrement ttl */ |
@@ -929,15 +933,15 @@ static int batadv_check_unicast_ttvn(struct bat_priv *bat_priv, | |||
929 | struct orig_node *orig_node; | 933 | struct orig_node *orig_node; |
930 | struct ethhdr *ethhdr; | 934 | struct ethhdr *ethhdr; |
931 | struct hard_iface *primary_if; | 935 | struct hard_iface *primary_if; |
932 | struct unicast_packet *unicast_packet; | 936 | struct batadv_unicast_packet *unicast_packet; |
933 | bool tt_poss_change; | 937 | bool tt_poss_change; |
934 | int is_old_ttvn; | 938 | int is_old_ttvn; |
935 | 939 | ||
936 | /* I could need to modify it */ | 940 | /* I could need to modify it */ |
937 | if (skb_cow(skb, sizeof(struct unicast_packet)) < 0) | 941 | if (skb_cow(skb, sizeof(struct batadv_unicast_packet)) < 0) |
938 | return 0; | 942 | return 0; |
939 | 943 | ||
940 | unicast_packet = (struct unicast_packet *)skb->data; | 944 | unicast_packet = (struct batadv_unicast_packet *)skb->data; |
941 | 945 | ||
942 | if (batadv_is_my_mac(unicast_packet->dest)) { | 946 | if (batadv_is_my_mac(unicast_packet->dest)) { |
943 | tt_poss_change = bat_priv->tt_poss_change; | 947 | tt_poss_change = bat_priv->tt_poss_change; |
@@ -958,12 +962,12 @@ static int batadv_check_unicast_ttvn(struct bat_priv *bat_priv, | |||
958 | is_old_ttvn = batadv_seq_before(unicast_packet->ttvn, curr_ttvn); | 962 | is_old_ttvn = batadv_seq_before(unicast_packet->ttvn, curr_ttvn); |
959 | if (is_old_ttvn || tt_poss_change) { | 963 | if (is_old_ttvn || tt_poss_change) { |
960 | /* check if there is enough data before accessing it */ | 964 | /* check if there is enough data before accessing it */ |
961 | if (pskb_may_pull(skb, sizeof(struct unicast_packet) + | 965 | if (pskb_may_pull(skb, sizeof(struct batadv_unicast_packet) + |
962 | ETH_HLEN) < 0) | 966 | ETH_HLEN) < 0) |
963 | return 0; | 967 | return 0; |
964 | 968 | ||
965 | ethhdr = (struct ethhdr *)(skb->data + | 969 | ethhdr = (struct ethhdr *)(skb->data + |
966 | sizeof(struct unicast_packet)); | 970 | sizeof(struct batadv_unicast_packet)); |
967 | 971 | ||
968 | /* we don't have an updated route for this client, so we should | 972 | /* we don't have an updated route for this client, so we should |
969 | * not try to reroute the packet!! | 973 | * not try to reroute the packet!! |
@@ -1005,7 +1009,7 @@ static int batadv_check_unicast_ttvn(struct bat_priv *bat_priv, | |||
1005 | int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | 1009 | int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if) |
1006 | { | 1010 | { |
1007 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 1011 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
1008 | struct unicast_packet *unicast_packet; | 1012 | struct batadv_unicast_packet *unicast_packet; |
1009 | int hdr_size = sizeof(*unicast_packet); | 1013 | int hdr_size = sizeof(*unicast_packet); |
1010 | 1014 | ||
1011 | if (batadv_check_unicast_packet(skb, hdr_size) < 0) | 1015 | if (batadv_check_unicast_packet(skb, hdr_size) < 0) |
@@ -1014,7 +1018,7 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1014 | if (!batadv_check_unicast_ttvn(bat_priv, skb)) | 1018 | if (!batadv_check_unicast_ttvn(bat_priv, skb)) |
1015 | return NET_RX_DROP; | 1019 | return NET_RX_DROP; |
1016 | 1020 | ||
1017 | unicast_packet = (struct unicast_packet *)skb->data; | 1021 | unicast_packet = (struct batadv_unicast_packet *)skb->data; |
1018 | 1022 | ||
1019 | /* packet for me */ | 1023 | /* packet for me */ |
1020 | if (batadv_is_my_mac(unicast_packet->dest)) { | 1024 | if (batadv_is_my_mac(unicast_packet->dest)) { |
@@ -1030,7 +1034,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb, | |||
1030 | struct hard_iface *recv_if) | 1034 | struct hard_iface *recv_if) |
1031 | { | 1035 | { |
1032 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 1036 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
1033 | struct unicast_frag_packet *unicast_packet; | 1037 | struct batadv_unicast_frag_packet *unicast_packet; |
1034 | int hdr_size = sizeof(*unicast_packet); | 1038 | int hdr_size = sizeof(*unicast_packet); |
1035 | struct sk_buff *new_skb = NULL; | 1039 | struct sk_buff *new_skb = NULL; |
1036 | int ret; | 1040 | int ret; |
@@ -1041,7 +1045,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb, | |||
1041 | if (!batadv_check_unicast_ttvn(bat_priv, skb)) | 1045 | if (!batadv_check_unicast_ttvn(bat_priv, skb)) |
1042 | return NET_RX_DROP; | 1046 | return NET_RX_DROP; |
1043 | 1047 | ||
1044 | unicast_packet = (struct unicast_frag_packet *)skb->data; | 1048 | unicast_packet = (struct batadv_unicast_frag_packet *)skb->data; |
1045 | 1049 | ||
1046 | /* packet for me */ | 1050 | /* packet for me */ |
1047 | if (batadv_is_my_mac(unicast_packet->dest)) { | 1051 | if (batadv_is_my_mac(unicast_packet->dest)) { |
@@ -1056,7 +1060,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb, | |||
1056 | return NET_RX_SUCCESS; | 1060 | return NET_RX_SUCCESS; |
1057 | 1061 | ||
1058 | batadv_interface_rx(recv_if->soft_iface, new_skb, recv_if, | 1062 | batadv_interface_rx(recv_if->soft_iface, new_skb, recv_if, |
1059 | sizeof(struct unicast_packet)); | 1063 | sizeof(struct batadv_unicast_packet)); |
1060 | return NET_RX_SUCCESS; | 1064 | return NET_RX_SUCCESS; |
1061 | } | 1065 | } |
1062 | 1066 | ||
@@ -1068,7 +1072,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1068 | { | 1072 | { |
1069 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 1073 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
1070 | struct orig_node *orig_node = NULL; | 1074 | struct orig_node *orig_node = NULL; |
1071 | struct bcast_packet *bcast_packet; | 1075 | struct batadv_bcast_packet *bcast_packet; |
1072 | struct ethhdr *ethhdr; | 1076 | struct ethhdr *ethhdr; |
1073 | int hdr_size = sizeof(*bcast_packet); | 1077 | int hdr_size = sizeof(*bcast_packet); |
1074 | int ret = NET_RX_DROP; | 1078 | int ret = NET_RX_DROP; |
@@ -1092,7 +1096,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1092 | if (batadv_is_my_mac(ethhdr->h_source)) | 1096 | if (batadv_is_my_mac(ethhdr->h_source)) |
1093 | goto out; | 1097 | goto out; |
1094 | 1098 | ||
1095 | bcast_packet = (struct bcast_packet *)skb->data; | 1099 | bcast_packet = (struct batadv_bcast_packet *)skb->data; |
1096 | 1100 | ||
1097 | /* ignore broadcasts originated by myself */ | 1101 | /* ignore broadcasts originated by myself */ |
1098 | if (batadv_is_my_mac(bcast_packet->orig)) | 1102 | if (batadv_is_my_mac(bcast_packet->orig)) |
@@ -1156,7 +1160,7 @@ out: | |||
1156 | 1160 | ||
1157 | int batadv_recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if) | 1161 | int batadv_recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if) |
1158 | { | 1162 | { |
1159 | struct vis_packet *vis_packet; | 1163 | struct batadv_vis_packet *vis_packet; |
1160 | struct ethhdr *ethhdr; | 1164 | struct ethhdr *ethhdr; |
1161 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 1165 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
1162 | int hdr_size = sizeof(*vis_packet); | 1166 | int hdr_size = sizeof(*vis_packet); |
@@ -1168,7 +1172,7 @@ int batadv_recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1168 | if (unlikely(!pskb_may_pull(skb, hdr_size))) | 1172 | if (unlikely(!pskb_may_pull(skb, hdr_size))) |
1169 | return NET_RX_DROP; | 1173 | return NET_RX_DROP; |
1170 | 1174 | ||
1171 | vis_packet = (struct vis_packet *)skb->data; | 1175 | vis_packet = (struct batadv_vis_packet *)skb->data; |
1172 | ethhdr = (struct ethhdr *)skb_mac_header(skb); | 1176 | ethhdr = (struct ethhdr *)skb_mac_header(skb); |
1173 | 1177 | ||
1174 | /* not for me */ | 1178 | /* not for me */ |