Commit 3eb8773e authored by Simon Wunderlich's avatar Simon Wunderlich Committed by Antonio Quartulli

batman-adv: rename bridge loop avoidance claim types

for consistency reasons within the code and with the documentation,
we should always call it "claim" and "unclaim".
Signed-off-by: default avatarSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: default avatarAntonio Quartulli <ordex@autistici.org>
parent 99e966fc
...@@ -295,7 +295,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac, ...@@ -295,7 +295,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac,
/* now we pretend that the client would have sent this ... */ /* now we pretend that the client would have sent this ... */
switch (claimtype) { switch (claimtype) {
case BATADV_CLAIM_TYPE_ADD: case BATADV_CLAIM_TYPE_CLAIM:
/* normal claim frame /* normal claim frame
* set Ethernet SRC to the clients mac * set Ethernet SRC to the clients mac
*/ */
...@@ -303,7 +303,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac, ...@@ -303,7 +303,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac,
batadv_dbg(BATADV_DBG_BLA, bat_priv, batadv_dbg(BATADV_DBG_BLA, bat_priv,
"bla_send_claim(): CLAIM %pM on vid %d\n", mac, vid); "bla_send_claim(): CLAIM %pM on vid %d\n", mac, vid);
break; break;
case BATADV_CLAIM_TYPE_DEL: case BATADV_CLAIM_TYPE_UNCLAIM:
/* unclaim frame /* unclaim frame
* set HW SRC to the clients mac * set HW SRC to the clients mac
*/ */
...@@ -468,7 +468,7 @@ static void batadv_bla_answer_request(struct batadv_priv *bat_priv, ...@@ -468,7 +468,7 @@ static void batadv_bla_answer_request(struct batadv_priv *bat_priv,
continue; continue;
batadv_bla_send_claim(bat_priv, claim->addr, claim->vid, batadv_bla_send_claim(bat_priv, claim->addr, claim->vid,
BATADV_CLAIM_TYPE_ADD); BATADV_CLAIM_TYPE_CLAIM);
} }
rcu_read_unlock(); rcu_read_unlock();
} }
...@@ -703,7 +703,7 @@ static int batadv_handle_unclaim(struct batadv_priv *bat_priv, ...@@ -703,7 +703,7 @@ static int batadv_handle_unclaim(struct batadv_priv *bat_priv,
if (primary_if && batadv_compare_eth(backbone_addr, if (primary_if && batadv_compare_eth(backbone_addr,
primary_if->net_dev->dev_addr)) primary_if->net_dev->dev_addr))
batadv_bla_send_claim(bat_priv, claim_addr, vid, batadv_bla_send_claim(bat_priv, claim_addr, vid,
BATADV_CLAIM_TYPE_DEL); BATADV_CLAIM_TYPE_UNCLAIM);
backbone_gw = batadv_backbone_hash_find(bat_priv, backbone_addr, vid); backbone_gw = batadv_backbone_hash_find(bat_priv, backbone_addr, vid);
...@@ -739,7 +739,7 @@ static int batadv_handle_claim(struct batadv_priv *bat_priv, ...@@ -739,7 +739,7 @@ static int batadv_handle_claim(struct batadv_priv *bat_priv,
batadv_bla_add_claim(bat_priv, claim_addr, vid, backbone_gw); batadv_bla_add_claim(bat_priv, claim_addr, vid, backbone_gw);
if (batadv_compare_eth(backbone_addr, primary_if->net_dev->dev_addr)) if (batadv_compare_eth(backbone_addr, primary_if->net_dev->dev_addr))
batadv_bla_send_claim(bat_priv, claim_addr, vid, batadv_bla_send_claim(bat_priv, claim_addr, vid,
BATADV_CLAIM_TYPE_ADD); BATADV_CLAIM_TYPE_CLAIM);
/* TODO: we could call something like tt_local_del() here. */ /* TODO: we could call something like tt_local_del() here. */
...@@ -784,12 +784,12 @@ static int batadv_check_claim_group(struct batadv_priv *bat_priv, ...@@ -784,12 +784,12 @@ static int batadv_check_claim_group(struct batadv_priv *bat_priv,
* otherwise assume it is in the hw_src * otherwise assume it is in the hw_src
*/ */
switch (bla_dst->type) { switch (bla_dst->type) {
case BATADV_CLAIM_TYPE_ADD: case BATADV_CLAIM_TYPE_CLAIM:
backbone_addr = hw_src; backbone_addr = hw_src;
break; break;
case BATADV_CLAIM_TYPE_REQUEST: case BATADV_CLAIM_TYPE_REQUEST:
case BATADV_CLAIM_TYPE_ANNOUNCE: case BATADV_CLAIM_TYPE_ANNOUNCE:
case BATADV_CLAIM_TYPE_DEL: case BATADV_CLAIM_TYPE_UNCLAIM:
backbone_addr = ethhdr->h_source; backbone_addr = ethhdr->h_source;
break; break;
default: default:
...@@ -905,12 +905,12 @@ static int batadv_bla_process_claim(struct batadv_priv *bat_priv, ...@@ -905,12 +905,12 @@ static int batadv_bla_process_claim(struct batadv_priv *bat_priv,
/* check for the different types of claim frames ... */ /* check for the different types of claim frames ... */
switch (bla_dst->type) { switch (bla_dst->type) {
case BATADV_CLAIM_TYPE_ADD: case BATADV_CLAIM_TYPE_CLAIM:
if (batadv_handle_claim(bat_priv, primary_if, hw_src, if (batadv_handle_claim(bat_priv, primary_if, hw_src,
ethhdr->h_source, vid)) ethhdr->h_source, vid))
return 1; return 1;
break; break;
case BATADV_CLAIM_TYPE_DEL: case BATADV_CLAIM_TYPE_UNCLAIM:
if (batadv_handle_unclaim(bat_priv, primary_if, if (batadv_handle_unclaim(bat_priv, primary_if,
ethhdr->h_source, hw_src, vid)) ethhdr->h_source, hw_src, vid))
return 1; return 1;
......
...@@ -92,8 +92,8 @@ enum batadv_tt_client_flags { ...@@ -92,8 +92,8 @@ enum batadv_tt_client_flags {
/* claim frame types for the bridge loop avoidance */ /* claim frame types for the bridge loop avoidance */
enum batadv_bla_claimframe { enum batadv_bla_claimframe {
BATADV_CLAIM_TYPE_ADD = 0x00, BATADV_CLAIM_TYPE_CLAIM = 0x00,
BATADV_CLAIM_TYPE_DEL = 0x01, BATADV_CLAIM_TYPE_UNCLAIM = 0x01,
BATADV_CLAIM_TYPE_ANNOUNCE = 0x02, BATADV_CLAIM_TYPE_ANNOUNCE = 0x02,
BATADV_CLAIM_TYPE_REQUEST = 0x03, BATADV_CLAIM_TYPE_REQUEST = 0x03,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment