diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-12 07:48:58 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-25 02:21:30 -0400 |
commit | 1eda58bfc56c43e73a0cf2bfb6e4d620ab866109 (patch) | |
tree | d71ba63d988193126831e49bdce03a1131d28ea4 /net/batman-adv/bridge_loop_avoidance.c | |
parent | f0530ee5fb9e73465ac844ada2c96a2bea85a18f (diff) |
batman-adv: Prefix main static inline functions with batadv_
All non-static symbols of batman-adv were prefixed with batadv_ to avoid
collisions with other symbols of the kernel. Other symbols of batman-adv
should use the same prefix to keep the naming scheme consistent.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/bridge_loop_avoidance.c')
-rw-r--r-- | net/batman-adv/bridge_loop_avoidance.c | 165 |
1 files changed, 84 insertions, 81 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index 1d143d5bb53e..b7d70845aa4a 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c | |||
@@ -294,25 +294,26 @@ static void bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac, | |||
294 | * set Ethernet SRC to the clients mac | 294 | * set Ethernet SRC to the clients mac |
295 | */ | 295 | */ |
296 | memcpy(ethhdr->h_source, mac, ETH_ALEN); | 296 | memcpy(ethhdr->h_source, mac, ETH_ALEN); |
297 | bat_dbg(DBG_BLA, bat_priv, | 297 | batadv_dbg(DBG_BLA, bat_priv, |
298 | "bla_send_claim(): CLAIM %pM on vid %d\n", mac, vid); | 298 | "bla_send_claim(): CLAIM %pM on vid %d\n", mac, vid); |
299 | break; | 299 | break; |
300 | case CLAIM_TYPE_DEL: | 300 | case CLAIM_TYPE_DEL: |
301 | /* unclaim frame | 301 | /* unclaim frame |
302 | * set HW SRC to the clients mac | 302 | * set HW SRC to the clients mac |
303 | */ | 303 | */ |
304 | memcpy(hw_src, mac, ETH_ALEN); | 304 | memcpy(hw_src, mac, ETH_ALEN); |
305 | bat_dbg(DBG_BLA, bat_priv, | 305 | batadv_dbg(DBG_BLA, bat_priv, |
306 | "bla_send_claim(): UNCLAIM %pM on vid %d\n", mac, vid); | 306 | "bla_send_claim(): UNCLAIM %pM on vid %d\n", mac, |
307 | vid); | ||
307 | break; | 308 | break; |
308 | case CLAIM_TYPE_ANNOUNCE: | 309 | case CLAIM_TYPE_ANNOUNCE: |
309 | /* announcement frame | 310 | /* announcement frame |
310 | * set HW SRC to the special mac containg the crc | 311 | * set HW SRC to the special mac containg the crc |
311 | */ | 312 | */ |
312 | memcpy(hw_src, mac, ETH_ALEN); | 313 | memcpy(hw_src, mac, ETH_ALEN); |
313 | bat_dbg(DBG_BLA, bat_priv, | 314 | batadv_dbg(DBG_BLA, bat_priv, |
314 | "bla_send_claim(): ANNOUNCE of %pM on vid %d\n", | 315 | "bla_send_claim(): ANNOUNCE of %pM on vid %d\n", |
315 | ethhdr->h_source, vid); | 316 | ethhdr->h_source, vid); |
316 | break; | 317 | break; |
317 | case CLAIM_TYPE_REQUEST: | 318 | case CLAIM_TYPE_REQUEST: |
318 | /* request frame | 319 | /* request frame |
@@ -320,9 +321,9 @@ static void bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac, | |||
320 | */ | 321 | */ |
321 | memcpy(hw_src, mac, ETH_ALEN); | 322 | memcpy(hw_src, mac, ETH_ALEN); |
322 | memcpy(ethhdr->h_dest, mac, ETH_ALEN); | 323 | memcpy(ethhdr->h_dest, mac, ETH_ALEN); |
323 | bat_dbg(DBG_BLA, bat_priv, | 324 | batadv_dbg(DBG_BLA, bat_priv, |
324 | "bla_send_claim(): REQUEST of %pM to %pMon vid %d\n", | 325 | "bla_send_claim(): REQUEST of %pM to %pMon vid %d\n", |
325 | ethhdr->h_source, ethhdr->h_dest, vid); | 326 | ethhdr->h_source, ethhdr->h_dest, vid); |
326 | break; | 327 | break; |
327 | 328 | ||
328 | } | 329 | } |
@@ -361,9 +362,9 @@ static struct backbone_gw *bla_get_backbone_gw(struct bat_priv *bat_priv, | |||
361 | if (entry) | 362 | if (entry) |
362 | return entry; | 363 | return entry; |
363 | 364 | ||
364 | bat_dbg(DBG_BLA, bat_priv, | 365 | batadv_dbg(DBG_BLA, bat_priv, |
365 | "bla_get_backbone_gw(): not found (%pM, %d), creating new entry\n", | 366 | "bla_get_backbone_gw(): not found (%pM, %d), creating new entry\n", |
366 | orig, vid); | 367 | orig, vid); |
367 | 368 | ||
368 | entry = kzalloc(sizeof(*entry), GFP_ATOMIC); | 369 | entry = kzalloc(sizeof(*entry), GFP_ATOMIC); |
369 | if (!entry) | 370 | if (!entry) |
@@ -433,8 +434,8 @@ static void bla_answer_request(struct bat_priv *bat_priv, | |||
433 | struct backbone_gw *backbone_gw; | 434 | struct backbone_gw *backbone_gw; |
434 | int i; | 435 | int i; |
435 | 436 | ||
436 | bat_dbg(DBG_BLA, bat_priv, | 437 | batadv_dbg(DBG_BLA, bat_priv, |
437 | "bla_answer_request(): received a claim request, send all of our own claims again\n"); | 438 | "bla_answer_request(): received a claim request, send all of our own claims again\n"); |
438 | 439 | ||
439 | backbone_gw = backbone_hash_find(bat_priv, | 440 | backbone_gw = backbone_hash_find(bat_priv, |
440 | primary_if->net_dev->dev_addr, vid); | 441 | primary_if->net_dev->dev_addr, vid); |
@@ -473,9 +474,8 @@ static void bla_send_request(struct backbone_gw *backbone_gw) | |||
473 | /* first, remove all old entries */ | 474 | /* first, remove all old entries */ |
474 | bla_del_backbone_claims(backbone_gw); | 475 | bla_del_backbone_claims(backbone_gw); |
475 | 476 | ||
476 | bat_dbg(DBG_BLA, backbone_gw->bat_priv, | 477 | batadv_dbg(DBG_BLA, backbone_gw->bat_priv, "Sending REQUEST to %pM\n", |
477 | "Sending REQUEST to %pM\n", | 478 | backbone_gw->orig); |
478 | backbone_gw->orig); | ||
479 | 479 | ||
480 | /* send request */ | 480 | /* send request */ |
481 | bla_send_claim(backbone_gw->bat_priv, backbone_gw->orig, | 481 | bla_send_claim(backbone_gw->bat_priv, backbone_gw->orig, |
@@ -538,9 +538,9 @@ static void bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac, | |||
538 | claim->backbone_gw = backbone_gw; | 538 | claim->backbone_gw = backbone_gw; |
539 | 539 | ||
540 | atomic_set(&claim->refcount, 2); | 540 | atomic_set(&claim->refcount, 2); |
541 | bat_dbg(DBG_BLA, bat_priv, | 541 | batadv_dbg(DBG_BLA, bat_priv, |
542 | "bla_add_claim(): adding new entry %pM, vid %d to hash ...\n", | 542 | "bla_add_claim(): adding new entry %pM, vid %d to hash ...\n", |
543 | mac, vid); | 543 | mac, vid); |
544 | hash_added = batadv_hash_add(bat_priv->claim_hash, | 544 | hash_added = batadv_hash_add(bat_priv->claim_hash, |
545 | compare_claim, choose_claim, | 545 | compare_claim, choose_claim, |
546 | claim, &claim->hash_entry); | 546 | claim, &claim->hash_entry); |
@@ -556,9 +556,9 @@ static void bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac, | |||
556 | /* no need to register a new backbone */ | 556 | /* no need to register a new backbone */ |
557 | goto claim_free_ref; | 557 | goto claim_free_ref; |
558 | 558 | ||
559 | bat_dbg(DBG_BLA, bat_priv, | 559 | batadv_dbg(DBG_BLA, bat_priv, |
560 | "bla_add_claim(): changing ownership for %pM, vid %d\n", | 560 | "bla_add_claim(): changing ownership for %pM, vid %d\n", |
561 | mac, vid); | 561 | mac, vid); |
562 | 562 | ||
563 | claim->backbone_gw->crc ^= | 563 | claim->backbone_gw->crc ^= |
564 | crc16(0, claim->addr, ETH_ALEN); | 564 | crc16(0, claim->addr, ETH_ALEN); |
@@ -590,7 +590,8 @@ static void bla_del_claim(struct bat_priv *bat_priv, const uint8_t *mac, | |||
590 | if (!claim) | 590 | if (!claim) |
591 | return; | 591 | return; |
592 | 592 | ||
593 | bat_dbg(DBG_BLA, bat_priv, "bla_del_claim(): %pM, vid %d\n", mac, vid); | 593 | batadv_dbg(DBG_BLA, bat_priv, "bla_del_claim(): %pM, vid %d\n", mac, |
594 | vid); | ||
594 | 595 | ||
595 | batadv_hash_remove(bat_priv->claim_hash, compare_claim, choose_claim, | 596 | batadv_hash_remove(bat_priv->claim_hash, compare_claim, choose_claim, |
596 | claim); | 597 | claim); |
@@ -622,15 +623,15 @@ static int handle_announce(struct bat_priv *bat_priv, | |||
622 | backbone_gw->lasttime = jiffies; | 623 | backbone_gw->lasttime = jiffies; |
623 | crc = ntohs(*((__be16 *)(&an_addr[4]))); | 624 | crc = ntohs(*((__be16 *)(&an_addr[4]))); |
624 | 625 | ||
625 | bat_dbg(DBG_BLA, bat_priv, | 626 | batadv_dbg(DBG_BLA, bat_priv, |
626 | "handle_announce(): ANNOUNCE vid %d (sent by %pM)... CRC = %04x\n", | 627 | "handle_announce(): ANNOUNCE vid %d (sent by %pM)... CRC = %04x\n", |
627 | vid, backbone_gw->orig, crc); | 628 | vid, backbone_gw->orig, crc); |
628 | 629 | ||
629 | if (backbone_gw->crc != crc) { | 630 | if (backbone_gw->crc != crc) { |
630 | bat_dbg(DBG_BLA, backbone_gw->bat_priv, | 631 | batadv_dbg(DBG_BLA, backbone_gw->bat_priv, |
631 | "handle_announce(): CRC FAILED for %pM/%d (my = %04x, sent = %04x)\n", | 632 | "handle_announce(): CRC FAILED for %pM/%d (my = %04x, sent = %04x)\n", |
632 | backbone_gw->orig, backbone_gw->vid, backbone_gw->crc, | 633 | backbone_gw->orig, backbone_gw->vid, |
633 | crc); | 634 | backbone_gw->crc, crc); |
634 | 635 | ||
635 | bla_send_request(backbone_gw); | 636 | bla_send_request(backbone_gw); |
636 | } else { | 637 | } else { |
@@ -654,18 +655,18 @@ static int handle_request(struct bat_priv *bat_priv, | |||
654 | struct ethhdr *ethhdr, short vid) | 655 | struct ethhdr *ethhdr, short vid) |
655 | { | 656 | { |
656 | /* check for REQUEST frame */ | 657 | /* check for REQUEST frame */ |
657 | if (!compare_eth(backbone_addr, ethhdr->h_dest)) | 658 | if (!batadv_compare_eth(backbone_addr, ethhdr->h_dest)) |
658 | return 0; | 659 | return 0; |
659 | 660 | ||
660 | /* sanity check, this should not happen on a normal switch, | 661 | /* sanity check, this should not happen on a normal switch, |
661 | * we ignore it in this case. | 662 | * we ignore it in this case. |
662 | */ | 663 | */ |
663 | if (!compare_eth(ethhdr->h_dest, primary_if->net_dev->dev_addr)) | 664 | if (!batadv_compare_eth(ethhdr->h_dest, primary_if->net_dev->dev_addr)) |
664 | return 1; | 665 | return 1; |
665 | 666 | ||
666 | bat_dbg(DBG_BLA, bat_priv, | 667 | batadv_dbg(DBG_BLA, bat_priv, |
667 | "handle_request(): REQUEST vid %d (sent by %pM)...\n", | 668 | "handle_request(): REQUEST vid %d (sent by %pM)...\n", |
668 | vid, ethhdr->h_source); | 669 | vid, ethhdr->h_source); |
669 | 670 | ||
670 | bla_answer_request(bat_priv, primary_if, vid); | 671 | bla_answer_request(bat_priv, primary_if, vid); |
671 | return 1; | 672 | return 1; |
@@ -680,8 +681,8 @@ static int handle_unclaim(struct bat_priv *bat_priv, | |||
680 | struct backbone_gw *backbone_gw; | 681 | struct backbone_gw *backbone_gw; |
681 | 682 | ||
682 | /* unclaim in any case if it is our own */ | 683 | /* unclaim in any case if it is our own */ |
683 | if (primary_if && compare_eth(backbone_addr, | 684 | if (primary_if && batadv_compare_eth(backbone_addr, |
684 | primary_if->net_dev->dev_addr)) | 685 | primary_if->net_dev->dev_addr)) |
685 | bla_send_claim(bat_priv, claim_addr, vid, CLAIM_TYPE_DEL); | 686 | bla_send_claim(bat_priv, claim_addr, vid, CLAIM_TYPE_DEL); |
686 | 687 | ||
687 | backbone_gw = backbone_hash_find(bat_priv, backbone_addr, vid); | 688 | backbone_gw = backbone_hash_find(bat_priv, backbone_addr, vid); |
@@ -690,9 +691,9 @@ static int handle_unclaim(struct bat_priv *bat_priv, | |||
690 | return 1; | 691 | return 1; |
691 | 692 | ||
692 | /* this must be an UNCLAIM frame */ | 693 | /* this must be an UNCLAIM frame */ |
693 | bat_dbg(DBG_BLA, bat_priv, | 694 | batadv_dbg(DBG_BLA, bat_priv, |
694 | "handle_unclaim(): UNCLAIM %pM on vid %d (sent by %pM)...\n", | 695 | "handle_unclaim(): UNCLAIM %pM on vid %d (sent by %pM)...\n", |
695 | claim_addr, vid, backbone_gw->orig); | 696 | claim_addr, vid, backbone_gw->orig); |
696 | 697 | ||
697 | bla_del_claim(bat_priv, claim_addr, vid); | 698 | bla_del_claim(bat_priv, claim_addr, vid); |
698 | backbone_gw_free_ref(backbone_gw); | 699 | backbone_gw_free_ref(backbone_gw); |
@@ -715,7 +716,7 @@ static int handle_claim(struct bat_priv *bat_priv, | |||
715 | 716 | ||
716 | /* this must be a CLAIM frame */ | 717 | /* this must be a CLAIM frame */ |
717 | bla_add_claim(bat_priv, claim_addr, vid, backbone_gw); | 718 | bla_add_claim(bat_priv, claim_addr, vid, backbone_gw); |
718 | if (compare_eth(backbone_addr, primary_if->net_dev->dev_addr)) | 719 | if (batadv_compare_eth(backbone_addr, primary_if->net_dev->dev_addr)) |
719 | bla_send_claim(bat_priv, claim_addr, vid, CLAIM_TYPE_ADD); | 720 | bla_send_claim(bat_priv, claim_addr, vid, CLAIM_TYPE_ADD); |
720 | 721 | ||
721 | /* TODO: we could call something like tt_local_del() here. */ | 722 | /* TODO: we could call something like tt_local_del() here. */ |
@@ -772,7 +773,7 @@ static int check_claim_group(struct bat_priv *bat_priv, | |||
772 | } | 773 | } |
773 | 774 | ||
774 | /* don't accept claim frames from ourselves */ | 775 | /* don't accept claim frames from ourselves */ |
775 | if (compare_eth(backbone_addr, primary_if->net_dev->dev_addr)) | 776 | if (batadv_compare_eth(backbone_addr, primary_if->net_dev->dev_addr)) |
776 | return 0; | 777 | return 0; |
777 | 778 | ||
778 | /* if its already the same group, it is fine. */ | 779 | /* if its already the same group, it is fine. */ |
@@ -790,9 +791,9 @@ static int check_claim_group(struct bat_priv *bat_priv, | |||
790 | 791 | ||
791 | /* if our mesh friends mac is bigger, use it for ourselves. */ | 792 | /* if our mesh friends mac is bigger, use it for ourselves. */ |
792 | if (ntohs(bla_dst->group) > ntohs(bla_dst_own->group)) { | 793 | if (ntohs(bla_dst->group) > ntohs(bla_dst_own->group)) { |
793 | bat_dbg(DBG_BLA, bat_priv, | 794 | batadv_dbg(DBG_BLA, bat_priv, |
794 | "taking other backbones claim group: %04x\n", | 795 | "taking other backbones claim group: %04x\n", |
795 | ntohs(bla_dst->group)); | 796 | ntohs(bla_dst->group)); |
796 | bla_dst_own->group = bla_dst->group; | 797 | bla_dst_own->group = bla_dst->group; |
797 | } | 798 | } |
798 | 799 | ||
@@ -867,9 +868,9 @@ static int bla_process_claim(struct bat_priv *bat_priv, | |||
867 | /* check if it is a claim frame. */ | 868 | /* check if it is a claim frame. */ |
868 | ret = check_claim_group(bat_priv, primary_if, hw_src, hw_dst, ethhdr); | 869 | ret = check_claim_group(bat_priv, primary_if, hw_src, hw_dst, ethhdr); |
869 | if (ret == 1) | 870 | if (ret == 1) |
870 | bat_dbg(DBG_BLA, bat_priv, | 871 | batadv_dbg(DBG_BLA, bat_priv, |
871 | "bla_process_claim(): received a claim frame from another group. From: %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n", | 872 | "bla_process_claim(): received a claim frame from another group. From: %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n", |
872 | ethhdr->h_source, vid, hw_src, hw_dst); | 873 | ethhdr->h_source, vid, hw_src, hw_dst); |
873 | 874 | ||
874 | if (ret < 2) | 875 | if (ret < 2) |
875 | return ret; | 876 | return ret; |
@@ -900,9 +901,9 @@ static int bla_process_claim(struct bat_priv *bat_priv, | |||
900 | break; | 901 | break; |
901 | } | 902 | } |
902 | 903 | ||
903 | bat_dbg(DBG_BLA, bat_priv, | 904 | batadv_dbg(DBG_BLA, bat_priv, |
904 | "bla_process_claim(): ERROR - this looks like a claim frame, but is useless. eth src %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n", | 905 | "bla_process_claim(): ERROR - this looks like a claim frame, but is useless. eth src %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n", |
905 | ethhdr->h_source, vid, hw_src, hw_dst); | 906 | ethhdr->h_source, vid, hw_src, hw_dst); |
906 | return 1; | 907 | return 1; |
907 | } | 908 | } |
908 | 909 | ||
@@ -931,13 +932,13 @@ static void bla_purge_backbone_gw(struct bat_priv *bat_priv, int now) | |||
931 | head, hash_entry) { | 932 | head, hash_entry) { |
932 | if (now) | 933 | if (now) |
933 | goto purge_now; | 934 | goto purge_now; |
934 | if (!has_timed_out(backbone_gw->lasttime, | 935 | if (!batadv_has_timed_out(backbone_gw->lasttime, |
935 | BLA_BACKBONE_TIMEOUT)) | 936 | BLA_BACKBONE_TIMEOUT)) |
936 | continue; | 937 | continue; |
937 | 938 | ||
938 | bat_dbg(DBG_BLA, backbone_gw->bat_priv, | 939 | batadv_dbg(DBG_BLA, backbone_gw->bat_priv, |
939 | "bla_purge_backbone_gw(): backbone gw %pM timed out\n", | 940 | "bla_purge_backbone_gw(): backbone gw %pM timed out\n", |
940 | backbone_gw->orig); | 941 | backbone_gw->orig); |
941 | 942 | ||
942 | purge_now: | 943 | purge_now: |
943 | /* don't wait for the pending request anymore */ | 944 | /* don't wait for the pending request anymore */ |
@@ -980,16 +981,16 @@ static void bla_purge_claims(struct bat_priv *bat_priv, | |||
980 | hlist_for_each_entry_rcu(claim, node, head, hash_entry) { | 981 | hlist_for_each_entry_rcu(claim, node, head, hash_entry) { |
981 | if (now) | 982 | if (now) |
982 | goto purge_now; | 983 | goto purge_now; |
983 | if (!compare_eth(claim->backbone_gw->orig, | 984 | if (!batadv_compare_eth(claim->backbone_gw->orig, |
984 | primary_if->net_dev->dev_addr)) | 985 | primary_if->net_dev->dev_addr)) |
985 | continue; | 986 | continue; |
986 | if (!has_timed_out(claim->lasttime, | 987 | if (!batadv_has_timed_out(claim->lasttime, |
987 | BLA_CLAIM_TIMEOUT)) | 988 | BLA_CLAIM_TIMEOUT)) |
988 | continue; | 989 | continue; |
989 | 990 | ||
990 | bat_dbg(DBG_BLA, bat_priv, | 991 | batadv_dbg(DBG_BLA, bat_priv, |
991 | "bla_purge_claims(): %pM, vid %d, time out\n", | 992 | "bla_purge_claims(): %pM, vid %d, time out\n", |
992 | claim->addr, claim->vid); | 993 | claim->addr, claim->vid); |
993 | 994 | ||
994 | purge_now: | 995 | purge_now: |
995 | handle_unclaim(bat_priv, primary_if, | 996 | handle_unclaim(bat_priv, primary_if, |
@@ -1036,8 +1037,8 @@ void batadv_bla_update_orig_address(struct bat_priv *bat_priv, | |||
1036 | rcu_read_lock(); | 1037 | rcu_read_lock(); |
1037 | hlist_for_each_entry_rcu(backbone_gw, node, head, hash_entry) { | 1038 | hlist_for_each_entry_rcu(backbone_gw, node, head, hash_entry) { |
1038 | /* own orig still holds the old value. */ | 1039 | /* own orig still holds the old value. */ |
1039 | if (!compare_eth(backbone_gw->orig, | 1040 | if (!batadv_compare_eth(backbone_gw->orig, |
1040 | oldif->net_dev->dev_addr)) | 1041 | oldif->net_dev->dev_addr)) |
1041 | continue; | 1042 | continue; |
1042 | 1043 | ||
1043 | memcpy(backbone_gw->orig, | 1044 | memcpy(backbone_gw->orig, |
@@ -1097,8 +1098,8 @@ static void bla_periodic_work(struct work_struct *work) | |||
1097 | 1098 | ||
1098 | rcu_read_lock(); | 1099 | rcu_read_lock(); |
1099 | hlist_for_each_entry_rcu(backbone_gw, node, head, hash_entry) { | 1100 | hlist_for_each_entry_rcu(backbone_gw, node, head, hash_entry) { |
1100 | if (!compare_eth(backbone_gw->orig, | 1101 | if (!batadv_compare_eth(backbone_gw->orig, |
1101 | primary_if->net_dev->dev_addr)) | 1102 | primary_if->net_dev->dev_addr)) |
1102 | continue; | 1103 | continue; |
1103 | 1104 | ||
1104 | backbone_gw->lasttime = jiffies; | 1105 | backbone_gw->lasttime = jiffies; |
@@ -1129,7 +1130,7 @@ int batadv_bla_init(struct bat_priv *bat_priv) | |||
1129 | uint8_t claim_dest[ETH_ALEN] = {0xff, 0x43, 0x05, 0x00, 0x00, 0x00}; | 1130 | uint8_t claim_dest[ETH_ALEN] = {0xff, 0x43, 0x05, 0x00, 0x00, 0x00}; |
1130 | struct hard_iface *primary_if; | 1131 | struct hard_iface *primary_if; |
1131 | 1132 | ||
1132 | bat_dbg(DBG_BLA, bat_priv, "bla hash registering\n"); | 1133 | batadv_dbg(DBG_BLA, bat_priv, "bla hash registering\n"); |
1133 | 1134 | ||
1134 | /* setting claim destination address */ | 1135 | /* setting claim destination address */ |
1135 | memcpy(&bat_priv->claim_dest.magic, claim_dest, 3); | 1136 | memcpy(&bat_priv->claim_dest.magic, claim_dest, 3); |
@@ -1164,7 +1165,7 @@ int batadv_bla_init(struct bat_priv *bat_priv) | |||
1164 | batadv_hash_set_lock_class(bat_priv->backbone_hash, | 1165 | batadv_hash_set_lock_class(bat_priv->backbone_hash, |
1165 | &backbone_hash_lock_class_key); | 1166 | &backbone_hash_lock_class_key); |
1166 | 1167 | ||
1167 | bat_dbg(DBG_BLA, bat_priv, "bla hashes initialized\n"); | 1168 | batadv_dbg(DBG_BLA, bat_priv, "bla hashes initialized\n"); |
1168 | 1169 | ||
1169 | bla_start_timer(bat_priv); | 1170 | bla_start_timer(bat_priv); |
1170 | return 0; | 1171 | return 0; |
@@ -1206,13 +1207,13 @@ int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv, | |||
1206 | /* we can stop searching if the entry is too old ; | 1207 | /* we can stop searching if the entry is too old ; |
1207 | * later entries will be even older | 1208 | * later entries will be even older |
1208 | */ | 1209 | */ |
1209 | if (has_timed_out(entry->entrytime, DUPLIST_TIMEOUT)) | 1210 | if (batadv_has_timed_out(entry->entrytime, DUPLIST_TIMEOUT)) |
1210 | break; | 1211 | break; |
1211 | 1212 | ||
1212 | if (entry->crc != crc) | 1213 | if (entry->crc != crc) |
1213 | continue; | 1214 | continue; |
1214 | 1215 | ||
1215 | if (compare_eth(entry->orig, bcast_packet->orig)) | 1216 | if (batadv_compare_eth(entry->orig, bcast_packet->orig)) |
1216 | continue; | 1217 | continue; |
1217 | 1218 | ||
1218 | /* this entry seems to match: same crc, not too old, | 1219 | /* this entry seems to match: same crc, not too old, |
@@ -1260,7 +1261,7 @@ int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig) | |||
1260 | 1261 | ||
1261 | rcu_read_lock(); | 1262 | rcu_read_lock(); |
1262 | hlist_for_each_entry_rcu(backbone_gw, node, head, hash_entry) { | 1263 | hlist_for_each_entry_rcu(backbone_gw, node, head, hash_entry) { |
1263 | if (compare_eth(backbone_gw->orig, orig)) { | 1264 | if (batadv_compare_eth(backbone_gw->orig, orig)) { |
1264 | rcu_read_unlock(); | 1265 | rcu_read_unlock(); |
1265 | return 1; | 1266 | return 1; |
1266 | } | 1267 | } |
@@ -1387,8 +1388,8 @@ int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) | |||
1387 | } | 1388 | } |
1388 | 1389 | ||
1389 | /* if it is our own claim ... */ | 1390 | /* if it is our own claim ... */ |
1390 | if (compare_eth(claim->backbone_gw->orig, | 1391 | if (batadv_compare_eth(claim->backbone_gw->orig, |
1391 | primary_if->net_dev->dev_addr)) { | 1392 | primary_if->net_dev->dev_addr)) { |
1392 | /* ... allow it in any case */ | 1393 | /* ... allow it in any case */ |
1393 | claim->lasttime = jiffies; | 1394 | claim->lasttime = jiffies; |
1394 | goto allow; | 1395 | goto allow; |
@@ -1474,8 +1475,8 @@ int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) | |||
1474 | goto allow; | 1475 | goto allow; |
1475 | 1476 | ||
1476 | /* check if we are responsible. */ | 1477 | /* check if we are responsible. */ |
1477 | if (compare_eth(claim->backbone_gw->orig, | 1478 | if (batadv_compare_eth(claim->backbone_gw->orig, |
1478 | primary_if->net_dev->dev_addr)) { | 1479 | primary_if->net_dev->dev_addr)) { |
1479 | /* if yes, the client has roamed and we have | 1480 | /* if yes, the client has roamed and we have |
1480 | * to unclaim it. | 1481 | * to unclaim it. |
1481 | */ | 1482 | */ |
@@ -1523,6 +1524,7 @@ int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset) | |||
1523 | uint32_t i; | 1524 | uint32_t i; |
1524 | bool is_own; | 1525 | bool is_own; |
1525 | int ret = 0; | 1526 | int ret = 0; |
1527 | uint8_t *primary_addr; | ||
1526 | 1528 | ||
1527 | primary_if = batadv_primary_if_get_selected(bat_priv); | 1529 | primary_if = batadv_primary_if_get_selected(bat_priv); |
1528 | if (!primary_if) { | 1530 | if (!primary_if) { |
@@ -1539,9 +1541,10 @@ int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset) | |||
1539 | goto out; | 1541 | goto out; |
1540 | } | 1542 | } |
1541 | 1543 | ||
1544 | primary_addr = primary_if->net_dev->dev_addr; | ||
1542 | seq_printf(seq, | 1545 | seq_printf(seq, |
1543 | "Claims announced for the mesh %s (orig %pM, group id %04x)\n", | 1546 | "Claims announced for the mesh %s (orig %pM, group id %04x)\n", |
1544 | net_dev->name, primary_if->net_dev->dev_addr, | 1547 | net_dev->name, primary_addr, |
1545 | ntohs(bat_priv->claim_dest.group)); | 1548 | ntohs(bat_priv->claim_dest.group)); |
1546 | seq_printf(seq, " %-17s %-5s %-17s [o] (%-4s)\n", | 1549 | seq_printf(seq, " %-17s %-5s %-17s [o] (%-4s)\n", |
1547 | "Client", "VID", "Originator", "CRC"); | 1550 | "Client", "VID", "Originator", "CRC"); |
@@ -1550,8 +1553,8 @@ int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset) | |||
1550 | 1553 | ||
1551 | rcu_read_lock(); | 1554 | rcu_read_lock(); |
1552 | hlist_for_each_entry_rcu(claim, node, head, hash_entry) { | 1555 | hlist_for_each_entry_rcu(claim, node, head, hash_entry) { |
1553 | is_own = compare_eth(claim->backbone_gw->orig, | 1556 | is_own = batadv_compare_eth(claim->backbone_gw->orig, |
1554 | primary_if->net_dev->dev_addr); | 1557 | primary_addr); |
1555 | seq_printf(seq, " * %pM on % 5d by %pM [%c] (%04x)\n", | 1558 | seq_printf(seq, " * %pM on % 5d by %pM [%c] (%04x)\n", |
1556 | claim->addr, claim->vid, | 1559 | claim->addr, claim->vid, |
1557 | claim->backbone_gw->orig, | 1560 | claim->backbone_gw->orig, |