Commit 3b300de3 authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Antonio Quartulli

batman-adv: Prefix bridge_loop_avoidance local static 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: default avatarSven Eckelmann <sven@narfation.org>
parent 0ff9b86f
...@@ -31,14 +31,14 @@ ...@@ -31,14 +31,14 @@
#include <net/arp.h> #include <net/arp.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
static const uint8_t announce_mac[4] = {0x43, 0x05, 0x43, 0x05}; static const uint8_t batadv_announce_mac[4] = {0x43, 0x05, 0x43, 0x05};
static void bla_periodic_work(struct work_struct *work); static void batadv_bla_periodic_work(struct work_struct *work);
static void bla_send_announce(struct bat_priv *bat_priv, static void batadv_bla_send_announce(struct bat_priv *bat_priv,
struct backbone_gw *backbone_gw); struct backbone_gw *backbone_gw);
/* return the index of the claim */ /* return the index of the claim */
static inline uint32_t choose_claim(const void *data, uint32_t size) static inline uint32_t batadv_choose_claim(const void *data, uint32_t size)
{ {
const unsigned char *key = data; const unsigned char *key = data;
uint32_t hash = 0; uint32_t hash = 0;
...@@ -58,7 +58,8 @@ static inline uint32_t choose_claim(const void *data, uint32_t size) ...@@ -58,7 +58,8 @@ static inline uint32_t choose_claim(const void *data, uint32_t size)
} }
/* return the index of the backbone gateway */ /* return the index of the backbone gateway */
static inline uint32_t choose_backbone_gw(const void *data, uint32_t size) static inline uint32_t batadv_choose_backbone_gw(const void *data,
uint32_t size)
{ {
const unsigned char *key = data; const unsigned char *key = data;
uint32_t hash = 0; uint32_t hash = 0;
...@@ -79,7 +80,8 @@ static inline uint32_t choose_backbone_gw(const void *data, uint32_t size) ...@@ -79,7 +80,8 @@ static inline uint32_t choose_backbone_gw(const void *data, uint32_t size)
/* compares address and vid of two backbone gws */ /* compares address and vid of two backbone gws */
static int compare_backbone_gw(const struct hlist_node *node, const void *data2) static int batadv_compare_backbone_gw(const struct hlist_node *node,
const void *data2)
{ {
const void *data1 = container_of(node, struct backbone_gw, const void *data1 = container_of(node, struct backbone_gw,
hash_entry); hash_entry);
...@@ -88,7 +90,8 @@ static int compare_backbone_gw(const struct hlist_node *node, const void *data2) ...@@ -88,7 +90,8 @@ static int compare_backbone_gw(const struct hlist_node *node, const void *data2)
} }
/* compares address and vid of two claims */ /* compares address and vid of two claims */
static int compare_claim(const struct hlist_node *node, const void *data2) static int batadv_compare_claim(const struct hlist_node *node,
const void *data2)
{ {
const void *data1 = container_of(node, struct claim, const void *data1 = container_of(node, struct claim,
hash_entry); hash_entry);
...@@ -97,28 +100,28 @@ static int compare_claim(const struct hlist_node *node, const void *data2) ...@@ -97,28 +100,28 @@ static int compare_claim(const struct hlist_node *node, const void *data2)
} }
/* free a backbone gw */ /* free a backbone gw */
static void backbone_gw_free_ref(struct backbone_gw *backbone_gw) static void batadv_backbone_gw_free_ref(struct backbone_gw *backbone_gw)
{ {
if (atomic_dec_and_test(&backbone_gw->refcount)) if (atomic_dec_and_test(&backbone_gw->refcount))
kfree_rcu(backbone_gw, rcu); kfree_rcu(backbone_gw, rcu);
} }
/* finally deinitialize the claim */ /* finally deinitialize the claim */
static void claim_free_rcu(struct rcu_head *rcu) static void batadv_claim_free_rcu(struct rcu_head *rcu)
{ {
struct claim *claim; struct claim *claim;
claim = container_of(rcu, struct claim, rcu); claim = container_of(rcu, struct claim, rcu);
backbone_gw_free_ref(claim->backbone_gw); batadv_backbone_gw_free_ref(claim->backbone_gw);
kfree(claim); kfree(claim);
} }
/* free a claim, call claim_free_rcu if its the last reference */ /* free a claim, call claim_free_rcu if its the last reference */
static void claim_free_ref(struct claim *claim) static void batadv_claim_free_ref(struct claim *claim)
{ {
if (atomic_dec_and_test(&claim->refcount)) if (atomic_dec_and_test(&claim->refcount))
call_rcu(&claim->rcu, claim_free_rcu); call_rcu(&claim->rcu, batadv_claim_free_rcu);
} }
/* @bat_priv: the bat priv with all the soft interface information /* @bat_priv: the bat priv with all the soft interface information
...@@ -127,7 +130,7 @@ static void claim_free_ref(struct claim *claim) ...@@ -127,7 +130,7 @@ static void claim_free_ref(struct claim *claim)
* looks for a claim in the hash, and returns it if found * looks for a claim in the hash, and returns it if found
* or NULL otherwise. * or NULL otherwise.
*/ */
static struct claim *claim_hash_find(struct bat_priv *bat_priv, static struct claim *batadv_claim_hash_find(struct bat_priv *bat_priv,
struct claim *data) struct claim *data)
{ {
struct hashtable_t *hash = bat_priv->claim_hash; struct hashtable_t *hash = bat_priv->claim_hash;
...@@ -140,12 +143,12 @@ static struct claim *claim_hash_find(struct bat_priv *bat_priv, ...@@ -140,12 +143,12 @@ static struct claim *claim_hash_find(struct bat_priv *bat_priv,
if (!hash) if (!hash)
return NULL; return NULL;
index = choose_claim(data, hash->size); index = batadv_choose_claim(data, hash->size);
head = &hash->table[index]; head = &hash->table[index];
rcu_read_lock(); rcu_read_lock();
hlist_for_each_entry_rcu(claim, node, head, hash_entry) { hlist_for_each_entry_rcu(claim, node, head, hash_entry) {
if (!compare_claim(&claim->hash_entry, data)) if (!batadv_compare_claim(&claim->hash_entry, data))
continue; continue;
if (!atomic_inc_not_zero(&claim->refcount)) if (!atomic_inc_not_zero(&claim->refcount))
...@@ -166,7 +169,7 @@ static struct claim *claim_hash_find(struct bat_priv *bat_priv, ...@@ -166,7 +169,7 @@ static struct claim *claim_hash_find(struct bat_priv *bat_priv,
* looks for a claim in the hash, and returns it if found * looks for a claim in the hash, and returns it if found
* or NULL otherwise. * or NULL otherwise.
*/ */
static struct backbone_gw *backbone_hash_find(struct bat_priv *bat_priv, static struct backbone_gw *batadv_backbone_hash_find(struct bat_priv *bat_priv,
uint8_t *addr, short vid) uint8_t *addr, short vid)
{ {
struct hashtable_t *hash = bat_priv->backbone_hash; struct hashtable_t *hash = bat_priv->backbone_hash;
...@@ -182,12 +185,12 @@ static struct backbone_gw *backbone_hash_find(struct bat_priv *bat_priv, ...@@ -182,12 +185,12 @@ static struct backbone_gw *backbone_hash_find(struct bat_priv *bat_priv,
memcpy(search_entry.orig, addr, ETH_ALEN); memcpy(search_entry.orig, addr, ETH_ALEN);
search_entry.vid = vid; search_entry.vid = vid;
index = choose_backbone_gw(&search_entry, hash->size); index = batadv_choose_backbone_gw(&search_entry, hash->size);
head = &hash->table[index]; head = &hash->table[index];
rcu_read_lock(); rcu_read_lock();
hlist_for_each_entry_rcu(backbone_gw, node, head, hash_entry) { hlist_for_each_entry_rcu(backbone_gw, node, head, hash_entry) {
if (!compare_backbone_gw(&backbone_gw->hash_entry, if (!batadv_compare_backbone_gw(&backbone_gw->hash_entry,
&search_entry)) &search_entry))
continue; continue;
...@@ -203,7 +206,7 @@ static struct backbone_gw *backbone_hash_find(struct bat_priv *bat_priv, ...@@ -203,7 +206,7 @@ static struct backbone_gw *backbone_hash_find(struct bat_priv *bat_priv,
} }
/* delete all claims for a backbone */ /* delete all claims for a backbone */
static void bla_del_backbone_claims(struct backbone_gw *backbone_gw) static void batadv_bla_del_backbone_claims(struct backbone_gw *backbone_gw)
{ {
struct hashtable_t *hash; struct hashtable_t *hash;
struct hlist_node *node, *node_tmp; struct hlist_node *node, *node_tmp;
...@@ -227,7 +230,7 @@ static void bla_del_backbone_claims(struct backbone_gw *backbone_gw) ...@@ -227,7 +230,7 @@ static void bla_del_backbone_claims(struct backbone_gw *backbone_gw)
if (claim->backbone_gw != backbone_gw) if (claim->backbone_gw != backbone_gw)
continue; continue;
claim_free_ref(claim); batadv_claim_free_ref(claim);
hlist_del_rcu(node); hlist_del_rcu(node);
} }
spin_unlock_bh(list_lock); spin_unlock_bh(list_lock);
...@@ -244,7 +247,7 @@ static void bla_del_backbone_claims(struct backbone_gw *backbone_gw) ...@@ -244,7 +247,7 @@ static void bla_del_backbone_claims(struct backbone_gw *backbone_gw)
* *
* sends a claim frame according to the provided info. * sends a claim frame according to the provided info.
*/ */
static void bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac, static void batadv_bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac,
short vid, int claimtype) short vid, int claimtype)
{ {
struct sk_buff *skb; struct sk_buff *skb;
...@@ -350,14 +353,14 @@ static void bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac, ...@@ -350,14 +353,14 @@ static void bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac,
* searches for the backbone gw or creates a new one if it could not * searches for the backbone gw or creates a new one if it could not
* be found. * be found.
*/ */
static struct backbone_gw *bla_get_backbone_gw(struct bat_priv *bat_priv, static struct backbone_gw *batadv_bla_get_backbone_gw(struct bat_priv *bat_priv,
uint8_t *orig, short vid) uint8_t *orig, short vid)
{ {
struct backbone_gw *entry; struct backbone_gw *entry;
struct orig_node *orig_node; struct orig_node *orig_node;
int hash_added; int hash_added;
entry = backbone_hash_find(bat_priv, orig, vid); entry = batadv_backbone_hash_find(bat_priv, orig, vid);
if (entry) if (entry)
return entry; return entry;
...@@ -381,8 +384,9 @@ static struct backbone_gw *bla_get_backbone_gw(struct bat_priv *bat_priv, ...@@ -381,8 +384,9 @@ static struct backbone_gw *bla_get_backbone_gw(struct bat_priv *bat_priv,
atomic_set(&entry->refcount, 2); atomic_set(&entry->refcount, 2);
hash_added = batadv_hash_add(bat_priv->backbone_hash, hash_added = batadv_hash_add(bat_priv->backbone_hash,
compare_backbone_gw, choose_backbone_gw, batadv_compare_backbone_gw,
entry, &entry->hash_entry); batadv_choose_backbone_gw, entry,
&entry->hash_entry);
if (unlikely(hash_added != 0)) { if (unlikely(hash_added != 0)) {
/* hash failed, free the structure */ /* hash failed, free the structure */
...@@ -403,19 +407,20 @@ static struct backbone_gw *bla_get_backbone_gw(struct bat_priv *bat_priv, ...@@ -403,19 +407,20 @@ static struct backbone_gw *bla_get_backbone_gw(struct bat_priv *bat_priv,
/* update or add the own backbone gw to make sure we announce /* update or add the own backbone gw to make sure we announce
* where we receive other backbone gws * where we receive other backbone gws
*/ */
static void bla_update_own_backbone_gw(struct bat_priv *bat_priv, static void batadv_bla_update_own_backbone_gw(struct bat_priv *bat_priv,
struct hard_iface *primary_if, struct hard_iface *primary_if,
short vid) short vid)
{ {
struct backbone_gw *backbone_gw; struct backbone_gw *backbone_gw;
backbone_gw = bla_get_backbone_gw(bat_priv, backbone_gw = batadv_bla_get_backbone_gw(bat_priv,
primary_if->net_dev->dev_addr, vid); primary_if->net_dev->dev_addr,
vid);
if (unlikely(!backbone_gw)) if (unlikely(!backbone_gw))
return; return;
backbone_gw->lasttime = jiffies; backbone_gw->lasttime = jiffies;
backbone_gw_free_ref(backbone_gw); batadv_backbone_gw_free_ref(backbone_gw);
} }
/* @bat_priv: the bat priv with all the soft interface information /* @bat_priv: the bat priv with all the soft interface information
...@@ -424,7 +429,7 @@ static void bla_update_own_backbone_gw(struct bat_priv *bat_priv, ...@@ -424,7 +429,7 @@ static void bla_update_own_backbone_gw(struct bat_priv *bat_priv,
* Repeat all of our own claims, and finally send an ANNOUNCE frame * Repeat all of our own claims, and finally send an ANNOUNCE frame
* to allow the requester another check if the CRC is correct now. * to allow the requester another check if the CRC is correct now.
*/ */
static void bla_answer_request(struct bat_priv *bat_priv, static void batadv_bla_answer_request(struct bat_priv *bat_priv,
struct hard_iface *primary_if, short vid) struct hard_iface *primary_if, short vid)
{ {
struct hlist_node *node; struct hlist_node *node;
...@@ -437,8 +442,9 @@ static void bla_answer_request(struct bat_priv *bat_priv, ...@@ -437,8 +442,9 @@ static void bla_answer_request(struct bat_priv *bat_priv,
batadv_dbg(DBG_BLA, bat_priv, batadv_dbg(DBG_BLA, bat_priv,
"bla_answer_request(): received a claim request, send all of our own claims again\n"); "bla_answer_request(): received a claim request, send all of our own claims again\n");
backbone_gw = backbone_hash_find(bat_priv, backbone_gw = batadv_backbone_hash_find(bat_priv,
primary_if->net_dev->dev_addr, vid); primary_if->net_dev->dev_addr,
vid);
if (!backbone_gw) if (!backbone_gw)
return; return;
...@@ -452,15 +458,15 @@ static void bla_answer_request(struct bat_priv *bat_priv, ...@@ -452,15 +458,15 @@ static void bla_answer_request(struct bat_priv *bat_priv,
if (claim->backbone_gw != backbone_gw) if (claim->backbone_gw != backbone_gw)
continue; continue;
bla_send_claim(bat_priv, claim->addr, claim->vid, batadv_bla_send_claim(bat_priv, claim->addr, claim->vid,
CLAIM_TYPE_ADD); CLAIM_TYPE_ADD);
} }
rcu_read_unlock(); rcu_read_unlock();
} }
/* finally, send an announcement frame */ /* finally, send an announcement frame */
bla_send_announce(bat_priv, backbone_gw); batadv_bla_send_announce(bat_priv, backbone_gw);
backbone_gw_free_ref(backbone_gw); batadv_backbone_gw_free_ref(backbone_gw);
} }
/* @backbone_gw: the backbone gateway from whom we are out of sync /* @backbone_gw: the backbone gateway from whom we are out of sync
...@@ -469,16 +475,16 @@ static void bla_answer_request(struct bat_priv *bat_priv, ...@@ -469,16 +475,16 @@ static void bla_answer_request(struct bat_priv *bat_priv,
* After the request, it will repeat all of his own claims and finally * After the request, it will repeat all of his own claims and finally
* send an announcement claim with which we can check again. * send an announcement claim with which we can check again.
*/ */
static void bla_send_request(struct backbone_gw *backbone_gw) static void batadv_bla_send_request(struct backbone_gw *backbone_gw)
{ {
/* first, remove all old entries */ /* first, remove all old entries */
bla_del_backbone_claims(backbone_gw); batadv_bla_del_backbone_claims(backbone_gw);
batadv_dbg(DBG_BLA, backbone_gw->bat_priv, "Sending REQUEST to %pM\n", batadv_dbg(DBG_BLA, backbone_gw->bat_priv, "Sending REQUEST to %pM\n",
backbone_gw->orig); backbone_gw->orig);
/* send request */ /* send request */
bla_send_claim(backbone_gw->bat_priv, backbone_gw->orig, batadv_bla_send_claim(backbone_gw->bat_priv, backbone_gw->orig,
backbone_gw->vid, CLAIM_TYPE_REQUEST); backbone_gw->vid, CLAIM_TYPE_REQUEST);
/* no local broadcasts should be sent or received, for now. */ /* no local broadcasts should be sent or received, for now. */
...@@ -494,17 +500,18 @@ static void bla_send_request(struct backbone_gw *backbone_gw) ...@@ -494,17 +500,18 @@ static void bla_send_request(struct backbone_gw *backbone_gw)
* This function sends an announcement. It is called from multiple * This function sends an announcement. It is called from multiple
* places. * places.
*/ */
static void bla_send_announce(struct bat_priv *bat_priv, static void batadv_bla_send_announce(struct bat_priv *bat_priv,
struct backbone_gw *backbone_gw) struct backbone_gw *backbone_gw)
{ {
uint8_t mac[ETH_ALEN]; uint8_t mac[ETH_ALEN];
__be16 crc; __be16 crc;
memcpy(mac, announce_mac, 4); memcpy(mac, batadv_announce_mac, 4);
crc = htons(backbone_gw->crc); crc = htons(backbone_gw->crc);
memcpy(&mac[4], &crc, 2); memcpy(&mac[4], &crc, 2);
bla_send_claim(bat_priv, mac, backbone_gw->vid, CLAIM_TYPE_ANNOUNCE); batadv_bla_send_claim(bat_priv, mac, backbone_gw->vid,
CLAIM_TYPE_ANNOUNCE);
} }
...@@ -515,8 +522,9 @@ static void bla_send_announce(struct bat_priv *bat_priv, ...@@ -515,8 +522,9 @@ static void bla_send_announce(struct bat_priv *bat_priv,
* *
* Adds a claim in the claim hash. * Adds a claim in the claim hash.
*/ */
static void bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac, static void batadv_bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac,
const short vid, struct backbone_gw *backbone_gw) const short vid,
struct backbone_gw *backbone_gw)
{ {
struct claim *claim; struct claim *claim;
struct claim search_claim; struct claim search_claim;
...@@ -524,7 +532,7 @@ static void bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac, ...@@ -524,7 +532,7 @@ static void bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac,
memcpy(search_claim.addr, mac, ETH_ALEN); memcpy(search_claim.addr, mac, ETH_ALEN);
search_claim.vid = vid; search_claim.vid = vid;
claim = claim_hash_find(bat_priv, &search_claim); claim = batadv_claim_hash_find(bat_priv, &search_claim);
/* create a new claim entry if it does not exist yet. */ /* create a new claim entry if it does not exist yet. */
if (!claim) { if (!claim) {
...@@ -542,8 +550,9 @@ static void bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac, ...@@ -542,8 +550,9 @@ static void bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac,
"bla_add_claim(): adding new entry %pM, vid %d to hash ...\n", "bla_add_claim(): adding new entry %pM, vid %d to hash ...\n",
mac, vid); mac, vid);
hash_added = batadv_hash_add(bat_priv->claim_hash, hash_added = batadv_hash_add(bat_priv->claim_hash,
compare_claim, choose_claim, batadv_compare_claim,
claim, &claim->hash_entry); batadv_choose_claim, claim,
&claim->hash_entry);
if (unlikely(hash_added != 0)) { if (unlikely(hash_added != 0)) {
/* only local changes happened. */ /* only local changes happened. */
...@@ -562,7 +571,7 @@ static void bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac, ...@@ -562,7 +571,7 @@ static void bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac,
claim->backbone_gw->crc ^= claim->backbone_gw->crc ^=
crc16(0, claim->addr, ETH_ALEN); crc16(0, claim->addr, ETH_ALEN);
backbone_gw_free_ref(claim->backbone_gw); batadv_backbone_gw_free_ref(claim->backbone_gw);
} }
/* set (new) backbone gw */ /* set (new) backbone gw */
...@@ -573,47 +582,48 @@ static void bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac, ...@@ -573,47 +582,48 @@ static void bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac,
backbone_gw->lasttime = jiffies; backbone_gw->lasttime = jiffies;
claim_free_ref: claim_free_ref:
claim_free_ref(claim); batadv_claim_free_ref(claim);
} }
/* Delete a claim from the claim hash which has the /* Delete a claim from the claim hash which has the
* given mac address and vid. * given mac address and vid.
*/ */
static void bla_del_claim(struct bat_priv *bat_priv, const uint8_t *mac, static void batadv_bla_del_claim(struct bat_priv *bat_priv, const uint8_t *mac,
const short vid) const short vid)
{ {
struct claim search_claim, *claim; struct claim search_claim, *claim;
memcpy(search_claim.addr, mac, ETH_ALEN); memcpy(search_claim.addr, mac, ETH_ALEN);
search_claim.vid = vid; search_claim.vid = vid;
claim = claim_hash_find(bat_priv, &search_claim); claim = batadv_claim_hash_find(bat_priv, &search_claim);
if (!claim) if (!claim)
return; return;
batadv_dbg(DBG_BLA, bat_priv, "bla_del_claim(): %pM, vid %d\n", mac, batadv_dbg(DBG_BLA, bat_priv, "bla_del_claim(): %pM, vid %d\n", mac,
vid); vid);
batadv_hash_remove(bat_priv->claim_hash, compare_claim, choose_claim, batadv_hash_remove(bat_priv->claim_hash, batadv_compare_claim,
claim); batadv_choose_claim, claim);
claim_free_ref(claim); /* reference from the hash is gone */ batadv_claim_free_ref(claim); /* reference from the hash is gone */
claim->backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN); claim->backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN);
/* don't need the reference from hash_find() anymore */ /* don't need the reference from hash_find() anymore */
claim_free_ref(claim); batadv_claim_free_ref(claim);
} }
/* check for ANNOUNCE frame, return 1 if handled */ /* check for ANNOUNCE frame, return 1 if handled */
static int handle_announce(struct bat_priv *bat_priv, static int batadv_handle_announce(struct bat_priv *bat_priv,
uint8_t *an_addr, uint8_t *backbone_addr, short vid) uint8_t *an_addr, uint8_t *backbone_addr,
short vid)
{ {
struct backbone_gw *backbone_gw; struct backbone_gw *backbone_gw;
uint16_t crc; uint16_t crc;
if (memcmp(an_addr, announce_mac, 4) != 0) if (memcmp(an_addr, batadv_announce_mac, 4) != 0)
return 0; return 0;
backbone_gw = bla_get_backbone_gw(bat_priv, backbone_addr, vid); backbone_gw = batadv_bla_get_backbone_gw(bat_priv, backbone_addr, vid);
if (unlikely(!backbone_gw)) if (unlikely(!backbone_gw))
return 1; return 1;
...@@ -633,7 +643,7 @@ static int handle_announce(struct bat_priv *bat_priv, ...@@ -633,7 +643,7 @@ static int handle_announce(struct bat_priv *bat_priv,
backbone_gw->orig, backbone_gw->vid, backbone_gw->orig, backbone_gw->vid,
backbone_gw->crc, crc); backbone_gw->crc, crc);
bla_send_request(backbone_gw); batadv_bla_send_request(backbone_gw);
} else { } else {
/* if we have sent a request and the crc was OK, /* if we have sent a request and the crc was OK,
* we can allow traffic again. * we can allow traffic again.
...@@ -644,12 +654,12 @@ static int handle_announce(struct bat_priv *bat_priv, ...@@ -644,12 +654,12 @@ static int handle_announce(struct bat_priv *bat_priv,
} }
} }
backbone_gw_free_ref(backbone_gw); batadv_backbone_gw_free_ref(backbone_gw);
return 1; return 1;
} }
/* check for REQUEST frame, return 1 if handled */ /* check for REQUEST frame, return 1 if handled */
static int handle_request(struct bat_priv *bat_priv, static int batadv_handle_request(struct bat_priv *bat_priv,
struct hard_iface *primary_if, struct hard_iface *primary_if,
uint8_t *backbone_addr, uint8_t *backbone_addr,
struct ethhdr *ethhdr, short vid) struct ethhdr *ethhdr, short vid)
...@@ -668,12 +678,12 @@ static int handle_request(struct bat_priv *bat_priv, ...@@ -668,12 +678,12 @@ static int handle_request(struct bat_priv *bat_priv,
"handle_request(): REQUEST vid %d (sent by %pM)...\n", "handle_request(): REQUEST vid %d (sent by %pM)...\n",
vid, ethhdr->h_source); vid, ethhdr->h_source);
bla_answer_request(bat_priv, primary_if, vid); batadv_bla_answer_request(bat_priv, primary_if, vid);
return 1; return 1;
} }
/* check for UNCLAIM frame, return 1 if handled */ /* check for UNCLAIM frame, return 1 if handled */
static int handle_unclaim(struct bat_priv *bat_priv, static int batadv_handle_unclaim(struct bat_priv *bat_priv,
struct hard_iface *primary_if, struct hard_iface *primary_if,
uint8_t *backbone_addr, uint8_t *backbone_addr,
uint8_t *claim_addr, short vid) uint8_t *claim_addr, short vid)
...@@ -683,9 +693,10 @@ static int handle_unclaim(struct bat_priv *bat_priv, ...@@ -683,9 +693,10 @@ static int handle_unclaim(struct bat_priv *bat_priv,
/* unclaim in any case if it is our own */ /* unclaim in any case if it is our own */
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))
bla_send_claim(bat_priv, claim_addr, vid, CLAIM_TYPE_DEL); batadv_bla_send_claim(bat_priv, claim_addr, vid,
CLAIM_TYPE_DEL);
backbone_gw = backbone_hash_find(bat_priv, backbone_addr, vid); backbone_gw = batadv_backbone_hash_find(bat_priv, backbone_addr, vid);
if (!backbone_gw) if (!backbone_gw)
return 1; return 1;
...@@ -695,33 +706,35 @@ static int handle_unclaim(struct bat_priv *bat_priv, ...@@ -695,33 +706,35 @@ static int handle_unclaim(struct bat_priv *bat_priv,
"handle_unclaim(): UNCLAIM %pM on vid %d (sent by %pM)...\n", "handle_unclaim(): UNCLAIM %pM on vid %d (sent by %pM)...\n",
claim_addr, vid, backbone_gw->orig); claim_addr, vid, backbone_gw->orig);
bla_del_claim(bat_priv, claim_addr, vid); batadv_bla_del_claim(bat_priv, claim_addr, vid);
backbone_gw_free_ref(backbone_gw); batadv_backbone_gw_free_ref(backbone_gw);
return 1; return 1;
} }
/* check for CLAIM frame, return 1 if handled */ /* check for CLAIM frame, return 1 if handled */
static int handle_claim(struct bat_priv *bat_priv, static int batadv_handle_claim(struct bat_priv *bat_priv,
struct hard_iface *primary_if, uint8_t *backbone_addr, struct hard_iface *primary_if,
uint8_t *claim_addr, short vid) uint8_t *backbone_addr, uint8_t *claim_addr,
short vid)
{ {
struct backbone_gw *backbone_gw; struct backbone_gw *backbone_gw;
/* register the gateway if not yet available, and add the claim. */ /* register the gateway if not yet available, and add the claim. */
backbone_gw = bla_get_backbone_gw(bat_priv, backbone_addr, vid); backbone_gw = batadv_bla_get_backbone_gw(bat_priv, backbone_addr, vid);
if (unlikely(!backbone_gw)) if (unlikely(!backbone_gw))
return 1; return 1;
/* this must be a CLAIM frame */ /* this must be a CLAIM frame */
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))
bla_send_claim(bat_priv, claim_addr, vid, CLAIM_TYPE_ADD); batadv_bla_send_claim(bat_priv, claim_addr, vid,
CLAIM_TYPE_ADD);
/* TODO: we could call something like tt_local_del() here. */ /* TODO: we could call something like tt_local_del() here. */
backbone_gw_free_ref(backbone_gw); batadv_backbone_gw_free_ref(backbone_gw);
return 1; return 1;
} }
...@@ -739,7 +752,7 @@ static int handle_claim(struct bat_priv *bat_priv, ...@@ -739,7 +752,7 @@ static int handle_claim(struct bat_priv *bat_priv,
* 1 - if is a claim packet from another group * 1 - if is a claim packet from another group
* 0 - if it is not a claim packet * 0 - if it is not a claim packet
*/ */
static int check_claim_group(struct bat_priv *bat_priv, static int batadv_check_claim_group(struct bat_priv *bat_priv,
struct hard_iface *primary_if, struct hard_iface *primary_if,
uint8_t *hw_src, uint8_t *hw_dst, uint8_t *hw_src, uint8_t *hw_dst,
struct ethhdr *ethhdr) struct ethhdr *ethhdr)
...@@ -811,7 +824,7 @@ static int check_claim_group(struct bat_priv *bat_priv, ...@@ -811,7 +824,7 @@ static int check_claim_group(struct bat_priv *bat_priv,
* returns 1 if it was a claim frame, otherwise return 0 to * returns 1 if it was a claim frame, otherwise return 0 to
* tell the callee that it can use the frame on its own. * tell the callee that it can use the frame on its own.
*/ */
static int bla_process_claim(struct bat_priv *bat_priv, static int batadv_bla_process_claim(struct bat_priv *bat_priv,
struct hard_iface *primary_if, struct hard_iface *primary_if,
struct sk_buff *skb) struct sk_buff *skb)
{ {
...@@ -866,7 +879,8 @@ static int bla_process_claim(struct bat_priv *bat_priv, ...@@ -866,7 +879,8 @@ static int bla_process_claim(struct bat_priv *bat_priv,
bla_dst = (struct bla_claim_dst *)hw_dst; bla_dst = (struct bla_claim_dst *)hw_dst;
/* check if it is a claim frame. */ /* check if it is a claim frame. */
ret = check_claim_group(bat_priv, primary_if, hw_src, hw_dst, ethhdr); ret = batadv_check_claim_group(bat_priv, primary_if, hw_src, hw_dst,
ethhdr);
if (ret == 1) if (ret == 1)
batadv_dbg(DBG_BLA, bat_priv, batadv_dbg(DBG_BLA, bat_priv,
"bla_process_claim(): received a claim frame from another group. From: %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n", "bla_process_claim(): received a claim frame from another group. From: %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n",
...@@ -876,27 +890,29 @@ static int bla_process_claim(struct bat_priv *bat_priv, ...@@ -876,27 +890,29 @@ static int bla_process_claim(struct bat_priv *bat_priv,
return ret; return ret;
/* become a backbone gw ourselves on this vlan if not happened yet */ /* become a backbone gw ourselves on this vlan if not happened yet */
bla_update_own_backbone_gw(bat_priv, primary_if, vid); batadv_bla_update_own_backbone_gw(bat_priv, primary_if, vid);
/* 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 CLAIM_TYPE_ADD: case CLAIM_TYPE_ADD:
if (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 CLAIM_TYPE_DEL: case CLAIM_TYPE_DEL:
if (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;
break; break;
case CLAIM_TYPE_ANNOUNCE: case CLAIM_TYPE_ANNOUNCE:
if (handle_announce(bat_priv, hw_src, ethhdr->h_source, vid)) if (batadv_handle_announce(bat_priv, hw_src, ethhdr->h_source,
vid))
return 1; return 1;
break; break;
case CLAIM_TYPE_REQUEST: case CLAIM_TYPE_REQUEST:
if (handle_request(bat_priv, primary_if, hw_src, ethhdr, vid)) if (batadv_handle_request(bat_priv, primary_if, hw_src, ethhdr,
vid))
return 1; return 1;
break; break;
} }
...@@ -910,7 +926,7 @@ static int bla_process_claim(struct bat_priv *bat_priv, ...@@ -910,7 +926,7 @@ static int bla_process_claim(struct bat_priv *bat_priv,
/* Check when we last heard from other nodes, and remove them in case of /* Check when we last heard from other nodes, and remove them in case of
* a time out, or clean all backbone gws if now is set. * a time out, or clean all backbone gws if now is set.
*/ */
static void bla_purge_backbone_gw(struct bat_priv *bat_priv, int now) static void batadv_bla_purge_backbone_gw(struct bat_priv *bat_priv, int now)
{ {
struct backbone_gw *backbone_gw; struct backbone_gw *backbone_gw;
struct hlist_node *node, *node_tmp; struct hlist_node *node, *node_tmp;
...@@ -945,10 +961,10 @@ static void bla_purge_backbone_gw(struct bat_priv *bat_priv, int now) ...@@ -945,10 +961,10 @@ static void bla_purge_backbone_gw(struct bat_priv *bat_priv, int now)
if (atomic_read(&backbone_gw->request_sent)) if (atomic_read(&backbone_gw->request_sent))
atomic_dec(&bat_priv->bla_num_requests); atomic_dec(&bat_priv->bla_num_requests);
bla_del_backbone_claims(backbone_gw); batadv_bla_del_backbone_claims(backbone_gw);
hlist_del_rcu(node); hlist_del_rcu(node);
backbone_gw_free_ref(backbone_gw); batadv_backbone_gw_free_ref(backbone_gw);
} }
spin_unlock_bh(list_lock); spin_unlock_bh(list_lock);
} }
...@@ -961,7 +977,7 @@ static void bla_purge_backbone_gw(struct bat_priv *bat_priv, int now) ...@@ -961,7 +977,7 @@ static void bla_purge_backbone_gw(struct bat_priv *bat_priv, int now)
* Check when we heard last time from our own claims, and remove them in case of * Check when we heard last time from our own claims, and remove them in case of
* a time out, or clean all claims if now is set * a time out, or clean all claims if now is set
*/ */
static void bla_purge_claims(struct bat_priv *bat_priv, static void batadv_bla_purge_claims(struct bat_priv *bat_priv,
struct hard_iface *primary_if, int now) struct hard_iface *primary_if, int now)
{ {
struct claim *claim; struct claim *claim;
...@@ -993,7 +1009,7 @@ static void bla_purge_claims(struct bat_priv *bat_priv, ...@@ -993,7 +1009,7 @@ static void bla_purge_claims(struct bat_priv *bat_priv,
claim->addr, claim->vid); claim->addr, claim->vid);
purge_now: purge_now:
handle_unclaim(bat_priv, primary_if, batadv_handle_unclaim(bat_priv, primary_if,
claim->backbone_gw->orig, claim->backbone_gw->orig,
claim->addr, claim->vid); claim->addr, claim->vid);
} }
...@@ -1022,8 +1038,8 @@ void batadv_bla_update_orig_address(struct bat_priv *bat_priv, ...@@ -1022,8 +1038,8 @@ void batadv_bla_update_orig_address(struct bat_priv *bat_priv,
htons(crc16(0, primary_if->net_dev->dev_addr, ETH_ALEN)); htons(crc16(0, primary_if->net_dev->dev_addr, ETH_ALEN));
if (!oldif) { if (!oldif) {
bla_purge_claims(bat_priv, NULL, 1); batadv_bla_purge_claims(bat_priv, NULL, 1);
bla_purge_backbone_gw(bat_priv, 1); batadv_bla_purge_backbone_gw(bat_priv, 1);
return; return;
} }
...@@ -1046,7 +1062,7 @@ void batadv_bla_update_orig_address(struct bat_priv *bat_priv, ...@@ -1046,7 +1062,7 @@ void batadv_bla_update_orig_address(struct bat_priv *bat_priv,
/* send an announce frame so others will ask for our /* send an announce frame so others will ask for our
* claims and update their tables. * claims and update their tables.
*/ */
bla_send_announce(bat_priv, backbone_gw); batadv_bla_send_announce(bat_priv, backbone_gw);
} }
rcu_read_unlock(); rcu_read_unlock();
} }
...@@ -1055,9 +1071,9 @@ void batadv_bla_update_orig_address(struct bat_priv *bat_priv, ...@@ -1055,9 +1071,9 @@ void batadv_bla_update_orig_address(struct bat_priv *bat_priv,
/* (re)start the timer */ /* (re)start the timer */
static void bla_start_timer(struct bat_priv *bat_priv) static void batadv_bla_start_timer(struct bat_priv *bat_priv)
{ {
INIT_DELAYED_WORK(&bat_priv->bla_work, bla_periodic_work); INIT_DELAYED_WORK(&bat_priv->bla_work, batadv_bla_periodic_work);
queue_delayed_work(batadv_event_workqueue, &bat_priv->bla_work, queue_delayed_work(batadv_event_workqueue, &bat_priv->bla_work,
msecs_to_jiffies(BLA_PERIOD_LENGTH)); msecs_to_jiffies(BLA_PERIOD_LENGTH));
} }
...@@ -1066,7 +1082,7 @@ static void bla_start_timer(struct bat_priv *bat_priv) ...@@ -1066,7 +1082,7 @@ static void bla_start_timer(struct bat_priv *bat_priv)
* * purge structures when they are too old * * purge structures when they are too old
* * send announcements * * send announcements
*/ */
static void bla_periodic_work(struct work_struct *work) static void batadv_bla_periodic_work(struct work_struct *work)
{ {
struct delayed_work *delayed_work = struct delayed_work *delayed_work =
container_of(work, struct delayed_work, work); container_of(work, struct delayed_work, work);
...@@ -1083,8 +1099,8 @@ static void bla_periodic_work(struct work_struct *work) ...@@ -1083,8 +1099,8 @@ static void bla_periodic_work(struct work_struct *work)
if (!primary_if) if (!primary_if)
goto out; goto out;
bla_purge_claims(bat_priv, primary_if, 0); batadv_bla_purge_claims(bat_priv, primary_if, 0);
bla_purge_backbone_gw(bat_priv, 0); batadv_bla_purge_backbone_gw(bat_priv, 0);
if (!atomic_read(&bat_priv->bridge_loop_avoidance)) if (!atomic_read(&bat_priv->bridge_loop_avoidance))
goto out; goto out;
...@@ -1104,7 +1120,7 @@ static void bla_periodic_work(struct work_struct *work) ...@@ -1104,7 +1120,7 @@ static void bla_periodic_work(struct work_struct *work)
backbone_gw->lasttime = jiffies; backbone_gw->lasttime = jiffies;
bla_send_announce(bat_priv, backbone_gw); batadv_bla_send_announce(bat_priv, backbone_gw);
} }
rcu_read_unlock(); rcu_read_unlock();
} }
...@@ -1112,7 +1128,7 @@ static void bla_periodic_work(struct work_struct *work) ...@@ -1112,7 +1128,7 @@ static void bla_periodic_work(struct work_struct *work)
if (primary_if) if (primary_if)
batadv_hardif_free_ref(primary_if); batadv_hardif_free_ref(primary_if);
bla_start_timer(bat_priv); batadv_bla_start_timer(bat_priv);
} }
/* The hash for claim and backbone hash receive the same key because they /* The hash for claim and backbone hash receive the same key because they
...@@ -1120,8 +1136,8 @@ static void bla_periodic_work(struct work_struct *work) ...@@ -1120,8 +1136,8 @@ static void bla_periodic_work(struct work_struct *work)
* them with to different keys to allow nested locking without generating * them with to different keys to allow nested locking without generating
* lockdep warnings * lockdep warnings
*/ */
static struct lock_class_key claim_hash_lock_class_key; static struct lock_class_key batadv_claim_hash_lock_class_key;
static struct lock_class_key backbone_hash_lock_class_key; static struct lock_class_key batadv_backbone_hash_lock_class_key;
/* initialize all bla structures */ /* initialize all bla structures */
int batadv_bla_init(struct bat_priv *bat_priv) int batadv_bla_init(struct bat_priv *bat_priv)
...@@ -1161,13 +1177,13 @@ int batadv_bla_init(struct bat_priv *bat_priv) ...@@ -1161,13 +1177,13 @@ int batadv_bla_init(struct bat_priv *bat_priv)
return -ENOMEM; return -ENOMEM;
batadv_hash_set_lock_class(bat_priv->claim_hash, batadv_hash_set_lock_class(bat_priv->claim_hash,
&claim_hash_lock_class_key); &batadv_claim_hash_lock_class_key);
batadv_hash_set_lock_class(bat_priv->backbone_hash, batadv_hash_set_lock_class(bat_priv->backbone_hash,
&backbone_hash_lock_class_key); &batadv_backbone_hash_lock_class_key);
batadv_dbg(DBG_BLA, bat_priv, "bla hashes initialized\n"); batadv_dbg(DBG_BLA, bat_priv, "bla hashes initialized\n");
bla_start_timer(bat_priv); batadv_bla_start_timer(bat_priv);
return 0; return 0;
} }
...@@ -1308,12 +1324,12 @@ int batadv_bla_is_backbone_gw(struct sk_buff *skb, ...@@ -1308,12 +1324,12 @@ int batadv_bla_is_backbone_gw(struct sk_buff *skb,
} }
/* see if this originator is a backbone gw for this VLAN */ /* see if this originator is a backbone gw for this VLAN */
backbone_gw = backbone_hash_find(orig_node->bat_priv, backbone_gw = batadv_backbone_hash_find(orig_node->bat_priv,
orig_node->orig, vid); orig_node->orig, vid);
if (!backbone_gw) if (!backbone_gw)
return 0; return 0;
backbone_gw_free_ref(backbone_gw); batadv_backbone_gw_free_ref(backbone_gw);
return 1; return 1;
} }
...@@ -1326,12 +1342,12 @@ void batadv_bla_free(struct bat_priv *bat_priv) ...@@ -1326,12 +1342,12 @@ void batadv_bla_free(struct bat_priv *bat_priv)
primary_if = batadv_primary_if_get_selected(bat_priv); primary_if = batadv_primary_if_get_selected(bat_priv);
if (bat_priv->claim_hash) { if (bat_priv->claim_hash) {
bla_purge_claims(bat_priv, primary_if, 1); batadv_bla_purge_claims(bat_priv, primary_if, 1);
batadv_hash_destroy(bat_priv->claim_hash); batadv_hash_destroy(bat_priv->claim_hash);
bat_priv->claim_hash = NULL; bat_priv->claim_hash = NULL;
} }
if (bat_priv->backbone_hash) { if (bat_priv->backbone_hash) {
bla_purge_backbone_gw(bat_priv, 1); batadv_bla_purge_backbone_gw(bat_priv, 1);
batadv_hash_destroy(bat_priv->backbone_hash); batadv_hash_destroy(bat_priv->backbone_hash);
bat_priv->backbone_hash = NULL; bat_priv->backbone_hash = NULL;
} }
...@@ -1375,13 +1391,13 @@ int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) ...@@ -1375,13 +1391,13 @@ int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN); memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN);
search_claim.vid = vid; search_claim.vid = vid;
claim = claim_hash_find(bat_priv, &search_claim); claim = batadv_claim_hash_find(bat_priv, &search_claim);
if (!claim) { if (!claim) {
/* possible optimization: race for a claim */ /* possible optimization: race for a claim */
/* No claim exists yet, claim it for us! /* No claim exists yet, claim it for us!
*/ */
handle_claim(bat_priv, primary_if, batadv_handle_claim(bat_priv, primary_if,
primary_if->net_dev->dev_addr, primary_if->net_dev->dev_addr,
ethhdr->h_source, vid); ethhdr->h_source, vid);
goto allow; goto allow;
...@@ -1404,13 +1420,13 @@ int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) ...@@ -1404,13 +1420,13 @@ int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
* send a claim and update the claim table * send a claim and update the claim table
* immediately. * immediately.
*/ */
handle_claim(bat_priv, primary_if, batadv_handle_claim(bat_priv, primary_if,
primary_if->net_dev->dev_addr, primary_if->net_dev->dev_addr,
ethhdr->h_source, vid); ethhdr->h_source, vid);
goto allow; goto allow;
} }
allow: allow:
bla_update_own_backbone_gw(bat_priv, primary_if, vid); batadv_bla_update_own_backbone_gw(bat_priv, primary_if, vid);
ret = 0; ret = 0;
goto out; goto out;
...@@ -1422,7 +1438,7 @@ int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) ...@@ -1422,7 +1438,7 @@ int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
if (primary_if) if (primary_if)
batadv_hardif_free_ref(primary_if); batadv_hardif_free_ref(primary_if);
if (claim) if (claim)
claim_free_ref(claim); batadv_claim_free_ref(claim);
return ret; return ret;
} }
...@@ -1455,7 +1471,7 @@ int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) ...@@ -1455,7 +1471,7 @@ int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
/* in VLAN case, the mac header might not be set. */ /* in VLAN case, the mac header might not be set. */
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
if (bla_process_claim(bat_priv, primary_if, skb)) if (batadv_bla_process_claim(bat_priv, primary_if, skb))
goto handled; goto handled;
ethhdr = (struct ethhdr *)skb_mac_header(skb); ethhdr = (struct ethhdr *)skb_mac_header(skb);
...@@ -1468,7 +1484,7 @@ int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) ...@@ -1468,7 +1484,7 @@ int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN); memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN);
search_claim.vid = vid; search_claim.vid = vid;
claim = claim_hash_find(bat_priv, &search_claim); claim = batadv_claim_hash_find(bat_priv, &search_claim);
/* if no claim exists, allow it. */ /* if no claim exists, allow it. */
if (!claim) if (!claim)
...@@ -1480,7 +1496,7 @@ int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) ...@@ -1480,7 +1496,7 @@ int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
/* if yes, the client has roamed and we have /* if yes, the client has roamed and we have
* to unclaim it. * to unclaim it.
*/ */
handle_unclaim(bat_priv, primary_if, batadv_handle_unclaim(bat_priv, primary_if,
primary_if->net_dev->dev_addr, primary_if->net_dev->dev_addr,
ethhdr->h_source, vid); ethhdr->h_source, vid);
goto allow; goto allow;
...@@ -1499,7 +1515,7 @@ int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) ...@@ -1499,7 +1515,7 @@ int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
goto allow; goto allow;
} }
allow: allow:
bla_update_own_backbone_gw(bat_priv, primary_if, vid); batadv_bla_update_own_backbone_gw(bat_priv, primary_if, vid);
ret = 0; ret = 0;
goto out; goto out;
handled: handled:
...@@ -1508,7 +1524,7 @@ int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) ...@@ -1508,7 +1524,7 @@ int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
if (primary_if) if (primary_if)
batadv_hardif_free_ref(primary_if); batadv_hardif_free_ref(primary_if);
if (claim) if (claim)
claim_free_ref(claim); batadv_claim_free_ref(claim);
return ret; return ret;
} }
......
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