batman-adv; branch, master, updated. v2012.1.0-134-g72e695e
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 72e695e40fb1a97df1b2d4b645c1507141eb85ea
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 10:45:53 2012 +0200
batman-adv: Prefix compat non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/compat.c b/compat.c
index 35ad397..702c7c1 100644
--- a/compat.c
+++ b/compat.c
@@ -28,7 +28,7 @@
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
-void free_rcu_gw_node(struct rcu_head *rcu)
+void batadv_free_rcu_gw_node(struct rcu_head *rcu)
{
struct gw_node *gw_node;
@@ -36,7 +36,7 @@ void free_rcu_gw_node(struct rcu_head *rcu)
kfree(gw_node);
}
-void free_rcu_neigh_node(struct rcu_head *rcu)
+void batadv_free_rcu_neigh_node(struct rcu_head *rcu)
{
struct neigh_node *neigh_node;
@@ -44,7 +44,7 @@ void free_rcu_neigh_node(struct rcu_head *rcu)
kfree(neigh_node);
}
-void free_rcu_tt_local_entry(struct rcu_head *rcu)
+void batadv_free_rcu_tt_local_entry(struct rcu_head *rcu)
{
struct tt_common_entry *tt_common_entry;
struct tt_local_entry *tt_local_entry;
@@ -56,7 +56,7 @@ void free_rcu_tt_local_entry(struct rcu_head *rcu)
}
#ifdef CONFIG_BATMAN_ADV_BLA
-void free_rcu_backbone_gw(struct rcu_head *rcu)
+void batadv_free_rcu_backbone_gw(struct rcu_head *rcu)
{
struct backbone_gw *backbone_gw;
diff --git a/compat.h b/compat.h
index 33c52d3..13ca624 100644
--- a/compat.h
+++ b/compat.h
@@ -138,13 +138,13 @@ static inline int __param_set_copystring(const char *val,
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
-#define kfree_rcu(ptr, rcu_head) call_rcu(&ptr->rcu_head, free_rcu_##ptr)
+#define kfree_rcu(ptr, rcu_head) call_rcu(&ptr->rcu_head, batadv_free_rcu_##ptr)
#define vlan_insert_tag(skb, vid) __vlan_put_tag(skb, vid)
-void free_rcu_gw_node(struct rcu_head *rcu);
-void free_rcu_neigh_node(struct rcu_head *rcu);
-void free_rcu_tt_local_entry(struct rcu_head *rcu);
-void free_rcu_backbone_gw(struct rcu_head *rcu);
+void batadv_free_rcu_gw_node(struct rcu_head *rcu);
+void batadv_free_rcu_neigh_node(struct rcu_head *rcu);
+void batadv_free_rcu_tt_local_entry(struct rcu_head *rcu);
+void batadv_free_rcu_backbone_gw(struct rcu_head *rcu);
#endif /* < KERNEL_VERSION(3, 0, 0) */
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-133-g017e28b
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 017e28bd11f975266ae1f7c8faaa6f5ed124fcf5
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 13:38:47 2012 +0200
batman-adv: Prefix bridge_loop_avoidance non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/bat_debugfs.c b/bat_debugfs.c
index 3b3790e..900c640 100644
--- a/bat_debugfs.c
+++ b/bat_debugfs.c
@@ -249,7 +249,8 @@ static int transtable_global_open(struct inode *inode, struct file *file)
static int bla_claim_table_open(struct inode *inode, struct file *file)
{
struct net_device *net_dev = (struct net_device *)inode->i_private;
- return single_open(file, bla_claim_table_seq_print_text, net_dev);
+ return single_open(file, batadv_bla_claim_table_seq_print_text,
+ net_dev);
}
#endif
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c
index 314e37b..b0561e3 100644
--- a/bridge_loop_avoidance.c
+++ b/bridge_loop_avoidance.c
@@ -1019,9 +1019,9 @@ purge_now:
* Update the backbone gateways when the own orig address changes.
*
*/
-void bla_update_orig_address(struct bat_priv *bat_priv,
- struct hard_iface *primary_if,
- struct hard_iface *oldif)
+void batadv_bla_update_orig_address(struct bat_priv *bat_priv,
+ struct hard_iface *primary_if,
+ struct hard_iface *oldif)
{
struct backbone_gw *backbone_gw;
struct hlist_node *node;
@@ -1136,7 +1136,7 @@ static struct lock_class_key claim_hash_lock_class_key;
static struct lock_class_key backbone_hash_lock_class_key;
/* initialize all bla structures */
-int bla_init(struct bat_priv *bat_priv)
+int batadv_bla_init(struct bat_priv *bat_priv)
{
int i;
uint8_t claim_dest[ETH_ALEN] = {0xff, 0x43, 0x05, 0x00, 0x00, 0x00};
@@ -1199,9 +1199,9 @@ int bla_init(struct bat_priv *bat_priv)
*
**/
-int bla_check_bcast_duplist(struct bat_priv *bat_priv,
- struct bcast_packet *bcast_packet,
- int hdr_size)
+int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv,
+ struct bcast_packet *bcast_packet,
+ int hdr_size)
{
int i, length, curr;
uint8_t *content;
@@ -1260,7 +1260,7 @@ int bla_check_bcast_duplist(struct bat_priv *bat_priv,
*
*/
-int bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig)
+int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig)
{
struct hashtable_t *hash = bat_priv->backbone_hash;
struct hlist_head *head;
@@ -1301,8 +1301,8 @@ int bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig)
* returns 0.
*
*/
-int bla_is_backbone_gw(struct sk_buff *skb,
- struct orig_node *orig_node, int hdr_size)
+int batadv_bla_is_backbone_gw(struct sk_buff *skb,
+ struct orig_node *orig_node, int hdr_size)
{
struct ethhdr *ethhdr;
struct vlan_ethhdr *vhdr;
@@ -1339,7 +1339,7 @@ int bla_is_backbone_gw(struct sk_buff *skb,
}
/* free all bla structures (for softinterface free or module unload) */
-void bla_free(struct bat_priv *bat_priv)
+void batadv_bla_free(struct bat_priv *bat_priv)
{
struct hard_iface *primary_if;
@@ -1374,7 +1374,7 @@ void bla_free(struct bat_priv *bat_priv)
* process the skb.
*
*/
-int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
+int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
{
struct ethhdr *ethhdr;
struct claim search_claim, *claim = NULL;
@@ -1463,7 +1463,7 @@ out:
* process the skb.
*
*/
-int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
+int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
{
struct ethhdr *ethhdr;
struct claim search_claim, *claim = NULL;
@@ -1537,7 +1537,7 @@ out:
return ret;
}
-int bla_claim_table_seq_print_text(struct seq_file *seq, void *offset)
+int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset)
{
struct net_device *net_dev = (struct net_device *)seq->private;
struct bat_priv *bat_priv = netdev_priv(net_dev);
diff --git a/bridge_loop_avoidance.h b/bridge_loop_avoidance.h
index e39f93a..546cd64 100644
--- a/bridge_loop_avoidance.h
+++ b/bridge_loop_avoidance.h
@@ -23,73 +23,76 @@
#define _NET_BATMAN_ADV_BLA_H_
#ifdef CONFIG_BATMAN_ADV_BLA
-int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid);
-int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid);
-int bla_is_backbone_gw(struct sk_buff *skb,
- struct orig_node *orig_node, int hdr_size);
-int bla_claim_table_seq_print_text(struct seq_file *seq, void *offset);
-int bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig);
-int bla_check_bcast_duplist(struct bat_priv *bat_priv,
- struct bcast_packet *bcast_packet, int hdr_size);
-void bla_update_orig_address(struct bat_priv *bat_priv,
- struct hard_iface *primary_if,
- struct hard_iface *oldif);
-int bla_init(struct bat_priv *bat_priv);
-void bla_free(struct bat_priv *bat_priv);
+int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid);
+int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid);
+int batadv_bla_is_backbone_gw(struct sk_buff *skb,
+ struct orig_node *orig_node, int hdr_size);
+int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset);
+int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig);
+int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv,
+ struct bcast_packet *bcast_packet,
+ int hdr_size);
+void batadv_bla_update_orig_address(struct bat_priv *bat_priv,
+ struct hard_iface *primary_if,
+ struct hard_iface *oldif);
+int batadv_bla_init(struct bat_priv *bat_priv);
+void batadv_bla_free(struct bat_priv *bat_priv);
#define BLA_CRC_INIT 0
#else /* ifdef CONFIG_BATMAN_ADV_BLA */
-static inline int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb,
- short vid)
+static inline int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb,
+ short vid)
{
return 0;
}
-static inline int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb,
- short vid)
+static inline int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb,
+ short vid)
{
return 0;
}
-static inline int bla_is_backbone_gw(struct sk_buff *skb,
- struct orig_node *orig_node,
- int hdr_size)
+static inline int batadv_bla_is_backbone_gw(struct sk_buff *skb,
+ struct orig_node *orig_node,
+ int hdr_size)
{
return 0;
}
-static inline int bla_claim_table_seq_print_text(struct seq_file *seq,
- void *offset)
+static inline int batadv_bla_claim_table_seq_print_text(struct seq_file *seq,
+ void *offset)
{
return 0;
}
-static inline int bla_is_backbone_gw_orig(struct bat_priv *bat_priv,
- uint8_t *orig)
+static inline int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv,
+ uint8_t *orig)
{
return 0;
}
-static inline int bla_check_bcast_duplist(struct bat_priv *bat_priv,
- struct bcast_packet *bcast_packet,
- int hdr_size)
+static inline int
+batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv,
+ struct bcast_packet *bcast_packet,
+ int hdr_size)
{
return 0;
}
-static inline void bla_update_orig_address(struct bat_priv *bat_priv,
- struct hard_iface *primary_if,
- struct hard_iface *oldif)
+static inline void
+batadv_bla_update_orig_address(struct bat_priv *bat_priv,
+ struct hard_iface *primary_if,
+ struct hard_iface *oldif)
{
}
-static inline int bla_init(struct bat_priv *bat_priv)
+static inline int batadv_bla_init(struct bat_priv *bat_priv)
{
return 1;
}
-static inline void bla_free(struct bat_priv *bat_priv)
+static inline void batadv_bla_free(struct bat_priv *bat_priv)
{
}
diff --git a/hard-interface.c b/hard-interface.c
index ceaf632..a42b2d3 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -121,7 +121,7 @@ static void primary_if_update_addr(struct bat_priv *bat_priv,
memcpy(vis_packet->sender_orig,
primary_if->net_dev->dev_addr, ETH_ALEN);
- bla_update_orig_address(bat_priv, primary_if, oldif);
+ batadv_bla_update_orig_address(bat_priv, primary_if, oldif);
out:
if (primary_if)
hardif_free_ref(primary_if);
diff --git a/main.c b/main.c
index 3bddd63..eb1d266 100644
--- a/main.c
+++ b/main.c
@@ -125,7 +125,7 @@ int mesh_init(struct net_device *soft_iface)
if (ret < 0)
goto err;
- ret = bla_init(bat_priv);
+ ret = batadv_bla_init(bat_priv);
if (ret < 0)
goto err;
@@ -154,7 +154,7 @@ void mesh_free(struct net_device *soft_iface)
tt_free(bat_priv);
- bla_free(bat_priv);
+ batadv_bla_free(bat_priv);
free_percpu(bat_priv->bat_counters);
diff --git a/routing.c b/routing.c
index 81baa48..e4d13dc 100644
--- a/routing.c
+++ b/routing.c
@@ -674,7 +674,7 @@ int recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
* roaming advertisement from it, as it has the same
* entries as we have.
*/
- if (bla_is_backbone_gw_orig(bat_priv, roam_adv_packet->src))
+ if (batadv_bla_is_backbone_gw_orig(bat_priv, roam_adv_packet->src))
goto out;
orig_node = orig_hash_find(bat_priv, roam_adv_packet->src);
@@ -1090,7 +1090,7 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
spin_unlock_bh(&orig_node->bcast_seqno_lock);
/* check whether this has been sent by another originator before */
- if (bla_check_bcast_duplist(bat_priv, bcast_packet, hdr_size))
+ if (batadv_bla_check_bcast_duplist(bat_priv, bcast_packet, hdr_size))
goto out;
/* rebroadcast packet */
@@ -1099,7 +1099,7 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
/* don't hand the broadcast up if it is from an originator
* from the same backbone.
*/
- if (bla_is_backbone_gw(skb, orig_node, hdr_size))
+ if (batadv_bla_is_backbone_gw(skb, orig_node, hdr_size))
goto out;
/* broadcast for me */
diff --git a/soft-interface.c b/soft-interface.c
index 6f21e65..92956c6 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -164,7 +164,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
goto dropped;
}
- if (bla_tx(bat_priv, skb, vid))
+ if (batadv_bla_tx(bat_priv, skb, vid))
goto dropped;
/* Register the client MAC in the transtable */
@@ -322,7 +322,7 @@ void interface_rx(struct net_device *soft_iface,
/* Let the bridge loop avoidance check the packet. If will
* not handle it, we can safely push it up.
*/
- if (bla_rx(bat_priv, skb, vid))
+ if (batadv_bla_rx(bat_priv, skb, vid))
goto out;
netif_rx(skb);
diff --git a/translation-table.c b/translation-table.c
index 621e188..2ecf3a2 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -1674,7 +1674,7 @@ bool send_tt_response(struct bat_priv *bat_priv,
{
if (is_my_mac(tt_request->dst)) {
/* don't answer backbone gws! */
- if (bla_is_backbone_gw_orig(bat_priv, tt_request->src))
+ if (batadv_bla_is_backbone_gw_orig(bat_priv, tt_request->src))
return true;
return send_my_tt_response(bat_priv, tt_request);
@@ -1786,7 +1786,7 @@ void handle_tt_response(struct bat_priv *bat_priv,
(tt_response->flags & TT_FULL_TABLE ? 'F' : '.'));
/* we should have never asked a backbone gw */
- if (bla_is_backbone_gw_orig(bat_priv, tt_response->src))
+ if (batadv_bla_is_backbone_gw_orig(bat_priv, tt_response->src))
goto out;
orig_node = orig_hash_find(bat_priv, tt_response->src);
@@ -2163,7 +2163,7 @@ void tt_update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node,
bool full_table = true;
/* don't care about a backbone gateways updates. */
- if (bla_is_backbone_gw_orig(bat_priv, orig_node->orig))
+ if (batadv_bla_is_backbone_gw_orig(bat_priv, orig_node->orig))
return;
/* orig table not initialised AND first diff is in the OGM OR the ttvn
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-132-g79c9763
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 79c97632c1bf666f95aa3e721ad00bf44bbde817
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:25 2012 +0200
batman-adv: Prefix bitarray non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index 470fe01..1e8b2d4 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -903,9 +903,9 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
set_mark = 0;
/* if the window moved, set the update flag. */
- need_update |= bit_get_packet(bat_priv,
- tmp_neigh_node->real_bits,
- seq_diff, set_mark);
+ need_update |= batadv_bit_get_packet(bat_priv,
+ tmp_neigh_node->real_bits,
+ seq_diff, set_mark);
tmp_neigh_node->real_packet_count =
bitmap_weight(tmp_neigh_node->real_bits,
diff --git a/bitarray.c b/bitarray.c
index 07ae6e1..99ed991 100644
--- a/bitarray.c
+++ b/bitarray.c
@@ -25,7 +25,7 @@
#include <linux/bitops.h>
/* shift the packet array by n places. */
-static void bat_bitmap_shift_left(unsigned long *seq_bits, int32_t n)
+static void batadv_bitmap_shift_left(unsigned long *seq_bits, int32_t n)
{
if (n <= 0 || n >= TQ_LOCAL_WINDOW_SIZE)
return;
@@ -40,8 +40,8 @@ static void bat_bitmap_shift_left(unsigned long *seq_bits, int32_t n)
* 1 if the window was moved (either new or very old)
* 0 if the window was not moved/shifted.
*/
-int bit_get_packet(void *priv, unsigned long *seq_bits,
- int32_t seq_num_diff, int set_mark)
+int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
+ int32_t seq_num_diff, int set_mark)
{
struct bat_priv *bat_priv = priv;
@@ -58,7 +58,7 @@ int bit_get_packet(void *priv, unsigned long *seq_bits,
* set the mark if required */
if ((seq_num_diff > 0) && (seq_num_diff < TQ_LOCAL_WINDOW_SIZE)) {
- bat_bitmap_shift_left(seq_bits, seq_num_diff);
+ batadv_bitmap_shift_left(seq_bits, seq_num_diff);
if (set_mark)
bat_set_bit(seq_bits, 0);
diff --git a/bitarray.h b/bitarray.h
index 1835c15..e855ddd 100644
--- a/bitarray.h
+++ b/bitarray.h
@@ -48,7 +48,7 @@ static inline void bat_set_bit(unsigned long *seq_bits, int32_t n)
/* receive and process one packet, returns 1 if received seq_num is considered
* new, 0 if old */
-int bit_get_packet(void *priv, unsigned long *seq_bits,
- int32_t seq_num_diff, int set_mark);
+int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
+ int32_t seq_num_diff, int set_mark);
#endif /* _NET_BATMAN_ADV_BITARRAY_H_ */
diff --git a/routing.c b/routing.c
index 8eec108..81baa48 100644
--- a/routing.c
+++ b/routing.c
@@ -54,7 +54,7 @@ void slide_own_bcast_window(struct hard_iface *hard_iface)
word_index = hard_iface->if_num * NUM_WORDS;
word = &(orig_node->bcast_own[word_index]);
- bit_get_packet(bat_priv, word, 1, 0);
+ batadv_bit_get_packet(bat_priv, word, 1, 0);
orig_node->bcast_own_sum[hard_iface->if_num] =
bitmap_weight(word, TQ_LOCAL_WINDOW_SIZE);
spin_unlock_bh(&orig_node->ogm_cnt_lock);
@@ -1084,7 +1084,7 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
/* mark broadcast in flood history, update window position
* if required. */
- if (bit_get_packet(bat_priv, orig_node->bcast_bits, seq_diff, 1))
+ if (batadv_bit_get_packet(bat_priv, orig_node->bcast_bits, seq_diff, 1))
orig_node->last_bcast_seqno = ntohl(bcast_packet->seqno);
spin_unlock_bh(&orig_node->bcast_seqno_lock);
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-131-gb5d0553
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit b5d0553a17ee3126adc028f9ae8c746b0acaaecc
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:24 2012 +0200
batman-adv: Prefix bat_sysfs non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/bat_sysfs.c b/bat_sysfs.c
index dc1edbe..5dce1ab 100644
--- a/bat_sysfs.c
+++ b/bat_sysfs.c
@@ -469,7 +469,7 @@ static struct bat_attribute *mesh_attrs[] = {
NULL,
};
-int sysfs_add_meshif(struct net_device *dev)
+int batadv_sysfs_add_meshif(struct net_device *dev)
{
struct kobject *batif_kobject = &dev->dev.kobj;
struct bat_priv *bat_priv = netdev_priv(dev);
@@ -507,7 +507,7 @@ out:
return -ENOMEM;
}
-void sysfs_del_meshif(struct net_device *dev)
+void batadv_sysfs_del_meshif(struct net_device *dev)
{
struct bat_priv *bat_priv = netdev_priv(dev);
struct bat_attribute **bat_attr;
@@ -637,7 +637,7 @@ static struct bat_attribute *batman_attrs[] = {
NULL,
};
-int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
+int batadv_sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
{
struct kobject *hardif_kobject = &dev->dev.kobj;
struct bat_attribute **bat_attr;
@@ -671,14 +671,14 @@ out:
return -ENOMEM;
}
-void sysfs_del_hardif(struct kobject **hardif_obj)
+void batadv_sysfs_del_hardif(struct kobject **hardif_obj)
{
kobject_put(*hardif_obj);
*hardif_obj = NULL;
}
-int throw_uevent(struct bat_priv *bat_priv, enum uev_type type,
- enum uev_action action, const char *data)
+int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type,
+ enum uev_action action, const char *data)
{
int ret = -ENOMEM;
struct hard_iface *primary_if = NULL;
diff --git a/bat_sysfs.h b/bat_sysfs.h
index fece77a..f01aea8 100644
--- a/bat_sysfs.h
+++ b/bat_sysfs.h
@@ -34,11 +34,12 @@ struct bat_attribute {
char *buf, size_t count);
};
-int sysfs_add_meshif(struct net_device *dev);
-void sysfs_del_meshif(struct net_device *dev);
-int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev);
-void sysfs_del_hardif(struct kobject **hardif_obj);
-int throw_uevent(struct bat_priv *bat_priv, enum uev_type type,
- enum uev_action action, const char *data);
+int batadv_sysfs_add_meshif(struct net_device *dev);
+void batadv_sysfs_del_meshif(struct net_device *dev);
+int batadv_sysfs_add_hardif(struct kobject **hardif_obj,
+ struct net_device *dev);
+void batadv_sysfs_del_hardif(struct kobject **hardif_obj);
+int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type,
+ enum uev_action action, const char *data);
#endif /* _NET_BATMAN_ADV_SYSFS_H_ */
diff --git a/gateway_client.c b/gateway_client.c
index 47f7186..1d7f08e 100644
--- a/gateway_client.c
+++ b/gateway_client.c
@@ -220,19 +220,19 @@ void gw_election(struct bat_priv *bat_priv)
if ((curr_gw) && (!next_gw)) {
bat_dbg(DBG_BATMAN, bat_priv,
"Removing selected gateway - no gateway in range\n");
- throw_uevent(bat_priv, UEV_GW, UEV_DEL, NULL);
+ batadv_throw_uevent(bat_priv, UEV_GW, UEV_DEL, NULL);
} else if ((!curr_gw) && (next_gw)) {
bat_dbg(DBG_BATMAN, bat_priv,
"Adding route to gateway %pM (gw_flags: %i, tq: %i)\n",
next_gw->orig_node->orig, next_gw->orig_node->gw_flags,
router->tq_avg);
- throw_uevent(bat_priv, UEV_GW, UEV_ADD, gw_addr);
+ batadv_throw_uevent(bat_priv, UEV_GW, UEV_ADD, gw_addr);
} else {
bat_dbg(DBG_BATMAN, bat_priv,
"Changing route to gateway %pM (gw_flags: %i, tq: %i)\n",
next_gw->orig_node->orig, next_gw->orig_node->gw_flags,
router->tq_avg);
- throw_uevent(bat_priv, UEV_GW, UEV_CHANGE, gw_addr);
+ batadv_throw_uevent(bat_priv, UEV_GW, UEV_CHANGE, gw_addr);
}
gw_select(bat_priv, next_gw);
diff --git a/hard-interface.c b/hard-interface.c
index 843caa7..ceaf632 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -426,7 +426,7 @@ static struct hard_iface *hardif_add_interface(struct net_device *net_dev)
if (!hard_iface)
goto release_dev;
- ret = sysfs_add_hardif(&hard_iface->hardif_obj, net_dev);
+ ret = batadv_sysfs_add_hardif(&hard_iface->hardif_obj, net_dev);
if (ret)
goto free_if;
@@ -470,7 +470,7 @@ static void hardif_remove_interface(struct hard_iface *hard_iface)
return;
hard_iface->if_status = IF_TO_BE_REMOVED;
- sysfs_del_hardif(&hard_iface->hardif_obj);
+ batadv_sysfs_del_hardif(&hard_iface->hardif_obj);
hardif_free_ref(hard_iface);
}
diff --git a/soft-interface.c b/soft-interface.c
index 1a9ba93..6f21e65 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -430,7 +430,7 @@ struct net_device *softif_create(const char *name)
if (ret < 0)
goto free_bat_counters;
- ret = sysfs_add_meshif(soft_iface);
+ ret = batadv_sysfs_add_meshif(soft_iface);
if (ret < 0)
goto free_bat_counters;
@@ -447,7 +447,7 @@ struct net_device *softif_create(const char *name)
unreg_debugfs:
batadv_debugfs_del_meshif(soft_iface);
unreg_sysfs:
- sysfs_del_meshif(soft_iface);
+ batadv_sysfs_del_meshif(soft_iface);
free_bat_counters:
free_percpu(bat_priv->bat_counters);
unreg_soft_iface:
@@ -463,7 +463,7 @@ out:
void softif_destroy(struct net_device *soft_iface)
{
batadv_debugfs_del_meshif(soft_iface);
- sysfs_del_meshif(soft_iface);
+ batadv_sysfs_del_meshif(soft_iface);
mesh_free(soft_iface);
unregister_netdevice(soft_iface);
}
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-130-g7bf28c4
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 7bf28c439fa917f2ac26385490f57bcad85d507a
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:23 2012 +0200
batman-adv: Prefix bat_debugfs non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/bat_debugfs.c b/bat_debugfs.c
index 3b588f8..3b3790e 100644
--- a/bat_debugfs.c
+++ b/bat_debugfs.c
@@ -76,7 +76,7 @@ static int fdebug_log(struct debug_log *debug_log, const char *fmt, ...)
return 0;
}
-int debug_log(struct bat_priv *bat_priv, const char *fmt, ...)
+int batadv_debug_log(struct bat_priv *bat_priv, const char *fmt, ...)
{
va_list args;
char tmp_log_buf[256];
@@ -304,7 +304,7 @@ static struct bat_debuginfo *mesh_debuginfos[] = {
NULL,
};
-void debugfs_init(void)
+void batadv_debugfs_init(void)
{
struct bat_debuginfo *bat_debug;
struct dentry *file;
@@ -327,7 +327,7 @@ out:
return;
}
-void debugfs_destroy(void)
+void batadv_debugfs_destroy(void)
{
if (bat_debugfs) {
debugfs_remove_recursive(bat_debugfs);
@@ -335,7 +335,7 @@ void debugfs_destroy(void)
}
}
-int debugfs_add_meshif(struct net_device *dev)
+int batadv_debugfs_add_meshif(struct net_device *dev)
{
struct bat_priv *bat_priv = netdev_priv(dev);
struct bat_debuginfo **bat_debug;
@@ -375,7 +375,7 @@ out:
#endif /* CONFIG_DEBUG_FS */
}
-void debugfs_del_meshif(struct net_device *dev)
+void batadv_debugfs_del_meshif(struct net_device *dev)
{
struct bat_priv *bat_priv = netdev_priv(dev);
diff --git a/bat_debugfs.h b/bat_debugfs.h
index d605c67..3b206c8 100644
--- a/bat_debugfs.h
+++ b/bat_debugfs.h
@@ -25,9 +25,9 @@
#define DEBUGFS_BAT_SUBDIR "batman_adv"
-void debugfs_init(void);
-void debugfs_destroy(void);
-int debugfs_add_meshif(struct net_device *dev);
-void debugfs_del_meshif(struct net_device *dev);
+void batadv_debugfs_init(void);
+void batadv_debugfs_destroy(void);
+int batadv_debugfs_add_meshif(struct net_device *dev);
+void batadv_debugfs_del_meshif(struct net_device *dev);
#endif /* _NET_BATMAN_ADV_DEBUGFS_H_ */
diff --git a/main.c b/main.c
index f272ed4..3bddd63 100644
--- a/main.c
+++ b/main.c
@@ -66,7 +66,7 @@ static int __init batman_init(void)
return -ENOMEM;
bat_socket_init();
- debugfs_init();
+ batadv_debugfs_init();
register_netdevice_notifier(&hard_if_notifier);
@@ -78,7 +78,7 @@ static int __init batman_init(void)
static void __exit batman_exit(void)
{
- debugfs_destroy();
+ batadv_debugfs_destroy();
unregister_netdevice_notifier(&hard_if_notifier);
hardif_remove_interfaces();
diff --git a/main.h b/main.h
index a94ceae..fef7fd6 100644
--- a/main.h
+++ b/main.h
@@ -182,12 +182,13 @@ int bat_algo_select(struct bat_priv *bat_priv, char *name);
int bat_algo_seq_print_text(struct seq_file *seq, void *offset);
#ifdef CONFIG_BATMAN_ADV_DEBUG
-int debug_log(struct bat_priv *bat_priv, const char *fmt, ...) __printf(2, 3);
+int batadv_debug_log(struct bat_priv *bat_priv, const char *fmt, ...)
+__printf(2, 3);
#define bat_dbg(type, bat_priv, fmt, arg...) \
do { \
if (atomic_read(&bat_priv->log_level) & type) \
- debug_log(bat_priv, fmt, ## arg); \
+ batadv_debug_log(bat_priv, fmt, ## arg);\
} \
while (0)
#else /* !CONFIG_BATMAN_ADV_DEBUG */
diff --git a/soft-interface.c b/soft-interface.c
index 101253d..1a9ba93 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -434,7 +434,7 @@ struct net_device *softif_create(const char *name)
if (ret < 0)
goto free_bat_counters;
- ret = debugfs_add_meshif(soft_iface);
+ ret = batadv_debugfs_add_meshif(soft_iface);
if (ret < 0)
goto unreg_sysfs;
@@ -445,7 +445,7 @@ struct net_device *softif_create(const char *name)
return soft_iface;
unreg_debugfs:
- debugfs_del_meshif(soft_iface);
+ batadv_debugfs_del_meshif(soft_iface);
unreg_sysfs:
sysfs_del_meshif(soft_iface);
free_bat_counters:
@@ -462,7 +462,7 @@ out:
void softif_destroy(struct net_device *soft_iface)
{
- debugfs_del_meshif(soft_iface);
+ batadv_debugfs_del_meshif(soft_iface);
sysfs_del_meshif(soft_iface);
mesh_free(soft_iface);
unregister_netdevice(soft_iface);
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-129-ga561da2
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit a561da2f5006d5fee0e4462aec7b612fb422e197
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:22 2012 +0200
batman-adv: Prefix bat_algo non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/bat_algo.h b/bat_algo.h
index 9852a68..a14336a 100644
--- a/bat_algo.h
+++ b/bat_algo.h
@@ -22,6 +22,6 @@
#ifndef _NET_BATMAN_ADV_BAT_ALGO_H_
#define _NET_BATMAN_ADV_BAT_ALGO_H_
-int bat_iv_init(void);
+int batadv_iv_init(void);
#endif /* _NET_BATMAN_ADV_BAT_ALGO_H_ */
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index f724d44..470fe01 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -1247,7 +1247,7 @@ static struct bat_algo_ops batman_iv __read_mostly = {
.bat_ogm_emit = bat_iv_ogm_emit,
};
-int __init bat_iv_init(void)
+int __init batadv_iv_init(void)
{
int ret;
diff --git a/main.c b/main.c
index 805373f..f272ed4 100644
--- a/main.c
+++ b/main.c
@@ -56,7 +56,7 @@ static int __init batman_init(void)
recv_handler_init();
- bat_iv_init();
+ batadv_iv_init();
/* the name should not be longer than 10 chars - see
* http://lwn.net/Articles/23634/ */
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-128-ga51ca5f
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit a51ca5f52c22b066a1df6ff7456ec5fb121a01a6
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:21 2012 +0200
batman-adv: Fix namespace for hash_set_lock_class
This function was introduced in 2c9aa3b4c37bd55148f5f25212c89e7bf5f28497
without a proper namespace prefix.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c
index 89e9721..314e37b 100644
--- a/bridge_loop_avoidance.c
+++ b/bridge_loop_avoidance.c
@@ -1172,9 +1172,10 @@ int bla_init(struct bat_priv *bat_priv)
if (!bat_priv->claim_hash || !bat_priv->backbone_hash)
return -ENOMEM;
- hash_set_lock_class(bat_priv->claim_hash, &claim_hash_lock_class_key);
- hash_set_lock_class(bat_priv->backbone_hash,
- &backbone_hash_lock_class_key);
+ batadv_hash_set_lock_class(bat_priv->claim_hash,
+ &claim_hash_lock_class_key);
+ batadv_hash_set_lock_class(bat_priv->backbone_hash,
+ &backbone_hash_lock_class_key);
bat_dbg(DBG_BLA, bat_priv, "bla hashes initialized\n");
diff --git a/hash.c b/hash.c
index 4578c20..a7dcff0 100644
--- a/hash.c
+++ b/hash.c
@@ -70,7 +70,8 @@ free_hash:
return NULL;
}
-void hash_set_lock_class(struct hashtable_t *hash, struct lock_class_key *key)
+void batadv_hash_set_lock_class(struct hashtable_t *hash,
+ struct lock_class_key *key)
{
uint32_t i;
diff --git a/hash.h b/hash.h
index 2e0409a..3d67ce4 100644
--- a/hash.h
+++ b/hash.h
@@ -46,7 +46,8 @@ struct hashtable_t {
struct hashtable_t *hash_new(uint32_t size);
/* set class key for all locks */
-void hash_set_lock_class(struct hashtable_t *hash, struct lock_class_key *key);
+void batadv_hash_set_lock_class(struct hashtable_t *hash,
+ struct lock_class_key *key);
/* free only the hashtable and the hash itself. */
void hash_destroy(struct hashtable_t *hash);
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-127-gc83ebbb
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit c83ebbba1d9bc75c2c056a128bea7c030b9f986e
Merge: cbe97119b339d684d2fa12ecd04506dfa07a28ac ccf1183f53baa879cd5a808dbb904f6053fa40f3
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Mon May 14 00:00:28 2012 +0800
Merge branch 'next'
diff --combined routing.c
index 9beb2e2,4f2059f..8eec108
--- a/routing.c
+++ b/routing.c
@@@ -573,7 -573,7 +573,7 @@@ int recv_tt_query(struct sk_buff *skb,
{
struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct tt_query_packet *tt_query;
- uint16_t tt_len;
+ uint16_t tt_size;
struct ethhdr *ethhdr;
/* drop packet if it has not necessary minimum size */
@@@ -596,10 -596,10 +596,10 @@@
tt_query = (struct tt_query_packet *)skb->data;
- tt_query->tt_data = ntohs(tt_query->tt_data);
-
switch (tt_query->flags & TT_QUERY_TYPE_MASK) {
case TT_REQUEST:
+ inc_counter(bat_priv, BAT_CNT_TT_REQUEST_RX);
+
/* If we cannot provide an answer the tt_request is
* forwarded */
if (!send_tt_response(bat_priv, tt_query)) {
@@@ -607,23 -607,22 +607,23 @@@
"Routing TT_REQUEST to %pM [%c]\n",
tt_query->dst,
(tt_query->flags & TT_FULL_TABLE ? 'F' : '.'));
- tt_query->tt_data = htons(tt_query->tt_data);
return route_unicast_packet(skb, recv_if);
}
break;
case TT_RESPONSE:
+ inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_RX);
+
if (is_my_mac(tt_query->dst)) {
/* packet needs to be linearized to access the TT
* changes */
if (skb_linearize(skb) < 0)
goto out;
- tt_len = tt_query->tt_data * sizeof(struct tt_change);
+ tt_size = tt_len(ntohs(tt_query->tt_data));
/* Ensure we have all the claimed data */
if (unlikely(skb_headlen(skb) <
- sizeof(struct tt_query_packet) + tt_len))
+ sizeof(struct tt_query_packet) + tt_size))
goto out;
handle_tt_response(bat_priv, tt_query);
@@@ -632,6 -631,7 +632,6 @@@
"Routing TT_RESPONSE to %pM [%c]\n",
tt_query->dst,
(tt_query->flags & TT_FULL_TABLE ? 'F' : '.'));
- tt_query->tt_data = htons(tt_query->tt_data);
return route_unicast_packet(skb, recv_if);
}
break;
@@@ -663,8 -663,6 +663,8 @@@ int recv_roam_adv(struct sk_buff *skb,
if (is_broadcast_ether_addr(ethhdr->h_source))
goto out;
+ inc_counter(bat_priv, BAT_CNT_TT_ROAM_ADV_RX);
+
roam_adv_packet = (struct roam_adv_packet *)skb->data;
if (!is_my_mac(roam_adv_packet->dst))
@@@ -872,10 -870,6 +872,10 @@@ static int route_unicast_packet(struct
/* decrement ttl */
unicast_packet->header.ttl--;
+ /* Update stats counter */
+ inc_counter(bat_priv, BAT_CNT_FORWARD);
+ add_counter(bat_priv, BAT_CNT_FORWARD_BYTES, skb->len + ETH_HLEN);
+
/* route it */
send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = NET_RX_SUCCESS;
@@@ -928,7 -922,8 +928,8 @@@ static int check_unicast_ttvn(struct ba
sizeof(struct unicast_packet));
/* we don't have an updated route for this client, so we should
- * not try to reroute the packet!! */
+ * not try to reroute the packet!!
+ */
if (tt_global_client_is_roaming(bat_priv, ethhdr->h_dest))
return 1;
diff --combined translation-table.c
index b16fb81,a66c2dc..621e188
--- a/translation-table.c
+++ b/translation-table.c
@@@ -181,14 -181,14 +181,14 @@@ int tt_len(int changes_num
static int tt_local_init(struct bat_priv *bat_priv)
{
if (bat_priv->tt_local_hash)
- return 1;
+ return 0;
bat_priv->tt_local_hash = hash_new(1024);
if (!bat_priv->tt_local_hash)
- return 0;
+ return -ENOMEM;
- return 1;
+ return 0;
}
void tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
@@@ -275,64 -275,14 +275,64 @@@ out
tt_global_entry_free_ref(tt_global_entry);
}
-int tt_changes_fill_buffer(struct bat_priv *bat_priv,
- unsigned char *buff, int buff_len)
+static void tt_realloc_packet_buff(unsigned char **packet_buff,
+ int *packet_buff_len, int min_packet_len,
+ int new_packet_len)
+{
+ unsigned char *new_buff;
+
+ new_buff = kmalloc(new_packet_len, GFP_ATOMIC);
+
+ /* keep old buffer if kmalloc should fail */
+ if (new_buff) {
+ memcpy(new_buff, *packet_buff, min_packet_len);
+ kfree(*packet_buff);
+ *packet_buff = new_buff;
+ *packet_buff_len = new_packet_len;
+ }
+}
+
+static void tt_prepare_packet_buff(struct bat_priv *bat_priv,
+ unsigned char **packet_buff,
+ int *packet_buff_len, int min_packet_len)
+{
+ struct hard_iface *primary_if;
+ int req_len;
+
+ primary_if = primary_if_get_selected(bat_priv);
+
+ req_len = min_packet_len;
+ req_len += tt_len(atomic_read(&bat_priv->tt_local_changes));
+
+ /* if we have too many changes for one packet don't send any
+ * and wait for the tt table request which will be fragmented
+ */
+ if ((!primary_if) || (req_len > primary_if->soft_iface->mtu))
+ req_len = min_packet_len;
+
+ tt_realloc_packet_buff(packet_buff, packet_buff_len,
+ min_packet_len, req_len);
+
+ if (primary_if)
+ hardif_free_ref(primary_if);
+}
+
+static int tt_changes_fill_buff(struct bat_priv *bat_priv,
+ unsigned char **packet_buff,
+ int *packet_buff_len, int min_packet_len)
{
- int count = 0, tot_changes = 0;
struct tt_change_node *entry, *safe;
+ int count = 0, tot_changes = 0, new_len;
+ unsigned char *tt_buff;
+
+ tt_prepare_packet_buff(bat_priv, packet_buff,
+ packet_buff_len, min_packet_len);
- if (buff_len > 0)
- tot_changes = buff_len / tt_len(1);
+ new_len = *packet_buff_len - min_packet_len;
+ tt_buff = *packet_buff + min_packet_len;
+
+ if (new_len > 0)
+ tot_changes = new_len / tt_len(1);
spin_lock_bh(&bat_priv->tt_changes_list_lock);
atomic_set(&bat_priv->tt_local_changes, 0);
@@@ -340,7 -290,7 +340,7 @@@
list_for_each_entry_safe(entry, safe, &bat_priv->tt_changes_list,
list) {
if (count < tot_changes) {
- memcpy(buff + tt_len(count),
+ memcpy(tt_buff + tt_len(count),
&entry->change, sizeof(struct tt_change));
count++;
}
@@@ -354,20 -304,22 +354,20 @@@
kfree(bat_priv->tt_buff);
bat_priv->tt_buff_len = 0;
bat_priv->tt_buff = NULL;
- /* We check whether this new OGM has no changes due to size
- * problems */
- if (buff_len > 0) {
- /**
- * if kmalloc() fails we will reply with the full table
+ /* check whether this new OGM has no changes due to size problems */
+ if (new_len > 0) {
+ /* if kmalloc() fails we will reply with the full table
* instead of providing the diff
*/
- bat_priv->tt_buff = kmalloc(buff_len, GFP_ATOMIC);
+ bat_priv->tt_buff = kmalloc(new_len, GFP_ATOMIC);
if (bat_priv->tt_buff) {
- memcpy(bat_priv->tt_buff, buff, buff_len);
- bat_priv->tt_buff_len = buff_len;
+ memcpy(bat_priv->tt_buff, tt_buff, new_len);
+ bat_priv->tt_buff_len = new_len;
}
}
spin_unlock_bh(&bat_priv->tt_buff_lock);
- return tot_changes;
+ return count;
}
int tt_local_seq_print_text(struct seq_file *seq, void *offset)
@@@ -539,14 -491,14 +539,14 @@@ static void tt_local_table_free(struct
static int tt_global_init(struct bat_priv *bat_priv)
{
if (bat_priv->tt_global_hash)
- return 1;
+ return 0;
bat_priv->tt_global_hash = hash_new(1024);
if (!bat_priv->tt_global_hash)
- return 0;
+ return -ENOMEM;
- return 1;
+ return 0;
}
static void tt_changes_list_free(struct bat_priv *bat_priv)
@@@ -1404,8 -1356,6 +1404,8 @@@ static int send_tt_request(struct bat_p
dst_orig_node->orig, neigh_node->addr,
(full_table ? 'F' : '.'));
+ inc_counter(bat_priv, BAT_CNT_TT_REQUEST_TX);
+
send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = 0;
@@@ -1466,7 -1416,7 +1466,7 @@@ static bool send_other_tt_response(stru
/* I don't have the requested data */
if (orig_ttvn != req_ttvn ||
- tt_request->tt_data != req_dst_orig_node->tt_crc)
+ tt_request->tt_data != htons(req_dst_orig_node->tt_crc))
goto out;
/* If the full table has been explicitly requested */
@@@ -1530,8 -1480,6 +1530,8 @@@
res_dst_orig_node->orig, neigh_node->addr,
req_dst_orig_node->orig, req_ttvn);
+ inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_TX);
+
send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = true;
goto out;
@@@ -1648,8 -1596,6 +1648,8 @@@ static bool send_my_tt_response(struct
orig_node->orig, neigh_node->addr,
(tt_response->flags & TT_FULL_TABLE ? 'F' : '.'));
+ inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_TX);
+
send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = true;
goto out;
@@@ -1726,7 -1672,7 +1726,7 @@@ static void tt_fill_gtable(struct bat_p
_tt_update_changes(bat_priv, orig_node,
(struct tt_change *)(tt_response + 1),
- tt_response->tt_data, tt_response->ttvn);
+ ntohs(tt_response->tt_data), tt_response->ttvn);
spin_lock_bh(&orig_node->tt_buff_lock);
kfree(orig_node->tt_buff);
@@@ -1781,8 -1727,7 +1781,8 @@@ void handle_tt_response(struct bat_pri
bat_dbg(DBG_TT, bat_priv,
"Received TT_RESPONSE from %pM for ttvn %d t_size: %d [%c]\n",
- tt_response->src, tt_response->ttvn, tt_response->tt_data,
+ tt_response->src, tt_response->ttvn,
+ ntohs(tt_response->tt_data),
(tt_response->flags & TT_FULL_TABLE ? 'F' : '.'));
/* we should have never asked a backbone gw */
@@@ -1796,8 -1741,7 +1796,8 @@@
if (tt_response->flags & TT_FULL_TABLE)
tt_fill_gtable(bat_priv, tt_response);
else
- tt_update_changes(bat_priv, orig_node, tt_response->tt_data,
+ tt_update_changes(bat_priv, orig_node,
+ ntohs(tt_response->tt_data),
tt_response->ttvn,
(struct tt_change *)(tt_response + 1));
@@@ -1823,15 -1767,11 +1823,15 @@@ out
int tt_init(struct bat_priv *bat_priv)
{
- if (!tt_local_init(bat_priv))
- return 0;
+ int ret;
- if (!tt_global_init(bat_priv))
- return 0;
+ ret = tt_local_init(bat_priv);
+ if (ret < 0)
+ return ret;
+
+ ret = tt_global_init(bat_priv);
+ if (ret < 0)
+ return ret;
tt_start_timer(bat_priv);
@@@ -1955,8 -1895,6 +1955,8 @@@ static void send_roam_adv(struct bat_pr
"Sending ROAMING_ADV to %pM (client %pM) via %pM\n",
orig_node->orig, client, neigh_node->addr);
+ inc_counter(bat_priv, BAT_CNT_TT_ROAM_ADV_TX);
+
send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = 0;
@@@ -2073,56 -2011,20 +2073,56 @@@ static void tt_local_purge_pending_clie
}
-void tt_commit_changes(struct bat_priv *bat_priv)
+static int tt_commit_changes(struct bat_priv *bat_priv,
+ unsigned char **packet_buff, int *packet_buff_len,
+ int packet_min_len)
{
- uint16_t changed_num = tt_set_flags(bat_priv->tt_local_hash,
- TT_CLIENT_NEW, false);
- /* all the reset entries have now to be effectively counted as local
- * entries */
+ uint16_t changed_num = 0;
+
+ if (atomic_read(&bat_priv->tt_local_changes) < 1)
+ return -ENOENT;
+
+ changed_num = tt_set_flags(bat_priv->tt_local_hash,
+ TT_CLIENT_NEW, false);
+
+ /* all reset entries have to be counted as local entries */
atomic_add(changed_num, &bat_priv->num_local_tt);
tt_local_purge_pending_clients(bat_priv);
+ bat_priv->tt_crc = tt_local_crc(bat_priv);
/* Increment the TTVN only once per OGM interval */
atomic_inc(&bat_priv->ttvn);
bat_dbg(DBG_TT, bat_priv, "Local changes committed, updating to ttvn %u\n",
(uint8_t)atomic_read(&bat_priv->ttvn));
bat_priv->tt_poss_change = false;
+
+ /* reset the sending counter */
+ atomic_set(&bat_priv->tt_ogm_append_cnt, TT_OGM_APPEND_MAX);
+
+ return tt_changes_fill_buff(bat_priv, packet_buff,
+ packet_buff_len, packet_min_len);
+}
+
+/* when calling this function (hard_iface == primary_if) has to be true */
+int batadv_tt_append_diff(struct bat_priv *bat_priv,
+ unsigned char **packet_buff, int *packet_buff_len,
+ int packet_min_len)
+{
+ int tt_num_changes;
+
+ /* if at least one change happened */
+ tt_num_changes = tt_commit_changes(bat_priv, packet_buff,
+ packet_buff_len, packet_min_len);
+
+ /* if the changes have been sent often enough */
+ if ((tt_num_changes < 0) &&
+ (!atomic_dec_not_zero(&bat_priv->tt_ogm_append_cnt))) {
+ tt_realloc_packet_buff(packet_buff, packet_buff_len,
+ packet_min_len, packet_min_len);
+ tt_num_changes = 0;
+ }
+
+ return tt_num_changes;
}
bool is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, uint8_t *dst)
@@@ -2220,7 -2122,8 +2220,8 @@@ request_table
/* returns true whether we know that the client has moved from its old
* originator to another one. This entry is kept is still kept for consistency
- * purposes */
+ * purposes
+ */
bool tt_global_client_is_roaming(struct bat_priv *bat_priv, uint8_t *addr)
{
struct tt_global_entry *tt_global_entry;
--
batman-adv
10 years, 1 month
batman-adv; branch, next, updated. v2012.1.0-95-gccf1183
by postmaster@open-mesh.org
The following commit has been merged in the next branch:
commit ccf1183f53baa879cd5a808dbb904f6053fa40f3
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sat May 12 14:38:01 2012 +0200
batman-adv: fix comment style and typo
Fix to David's style
Introduced by b46c60b9e1ee7a1909c542413a85875a750955d6
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
diff --git a/routing.c b/routing.c
index 2181a91..4f2059f 100644
--- a/routing.c
+++ b/routing.c
@@ -922,7 +922,8 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv,
sizeof(struct unicast_packet));
/* we don't have an updated route for this client, so we should
- * not try to reroute the packet!! */
+ * not try to reroute the packet!!
+ */
if (tt_global_client_is_roaming(bat_priv, ethhdr->h_dest))
return 1;
diff --git a/translation-table.c b/translation-table.c
index 88e4c8e..a66c2dc 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -2122,7 +2122,8 @@ request_table:
/* returns true whether we know that the client has moved from its old
* originator to another one. This entry is kept is still kept for consistency
- * purposes */
+ * purposes
+ */
bool tt_global_client_is_roaming(struct bat_priv *bat_priv, uint8_t *addr)
{
struct tt_global_entry *tt_global_entry;
diff --git a/unicast.c b/unicast.c
index 62ea9f1..e5c7999 100644
--- a/unicast.c
+++ b/unicast.c
@@ -395,10 +395,11 @@ find_router:
unicast_packet = (struct unicast_packet *)skb->data;
- /* inform the destination ode that we are still missing a correct route
+ /* inform the destination node that we are still missing a correct route
* for this client. The destination will receive this packet and will
* try to reroute it because the ttvn contained in the header is less
- * than the current one */
+ * than the current one
+ */
if (tt_global_client_is_roaming(bat_priv, ethhdr->h_dest))
unicast_packet->ttvn = unicast_packet->ttvn - 1;
--
batman-adv
10 years, 1 month
linux integration; annotated tag, batman-adv-for-davem, updated. batman-adv-for-davem
by postmaster@open-mesh.org
The annotated tag, batman-adv-for-davem has been updated
to f575c93b2106a4dbd0da657ae7abf019df2d421e (tag)
from 63c4ffbae4ae003eb3920a3da115501ea20f49dc (which is now obsolete)
tagging 1b0c84cbf9a744307c80a83dcdd3023f4d65f894 (commit)
replaces v3.4-rc5
tagged by Antonio Quartulli
on Sat May 12 14:28:22 2012 +0200
- Shortlog ------------------------------------------------------------
Included changes:
* an improvement to avoid to linearise the whole received packet when not needed
* an improvement for client traffic rerouting after roaming
* a fix for the local translation table state-machine
* minor cleanups and fixes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iQEcBAABAgAGBQJPrlgfAAoJEFMQTLzJFOZFrs0H/210iK5OFYtImrJvwORsz0dl
GSEVhKL+4QBTvf1jBFMYkTr8pEiUKuoCL87SZT7SFFuoNIyhAi0QeV6zdGPJu3e8
BaB+YzcyStYACVOx3qKPCa1tEsBFZajz2bB2V4afQf0VxXY/mw+eWqk/4WM//+7q
SsJA0Zl3vLdzi78Orz/CB70nQxOrt8/Hemt+IBOMAdmoLI2YBAs3phhkI/f8cTDE
s9ri70tN1Fo6vG8xUroDTqc+7GORtDnDOJkfkllgdjNHRstrT+z1Z66oY5w2grmK
BDH/kpSm0PDpndFtNylbSGZF7y/GIHEkAgTsZXuFlQ25MhEi4DhPPvjDDN4siSs=
=2zHC
-----END PGP SIGNATURE-----
Antonio Quartulli (13):
batman-adv: clean up Kconfig
batman-adv: use ETH_ALEN instead of hardcoded numeric constants
batman-adv: convert the tt_crc to network order
batman-adv: remove duplicated line in comment
batman-adv: use ETH_HLEN instead of sizeof(struct ethhdr)
batman-adv: print OGM seq numbers as unsigned int
batman-adv: skip the window protection test when the originator has no neighbours
batman-adv: fix wrong dhcp option list browsing
batman-adv: update copyright years
batman-adv: add contributor name
batman-adv: avoid skb_linearise() if not needed
batman-adv: improve unicast packet (re)routing
batman-adv: unset the TT_CLIENT_PENDING flag if the new local entry already exists
Eric Dumazet (1):
net: cleanup unsigned to unsigned int
Linus Luessing (1):
batman-adv: Adding hard_iface specific sysfs wrapper macros for UINT
Marek Lindner (22):
batman-adv: encourage batman to take shorter routes by changing the default hop penalty
batman-adv: move ogm initialization into the proper function
batman-adv: refactoring API: find generalized name for bat_ogm_init callback
batman-adv: randomize initial seqno to avoid collision
batman-adv: add iface_disable() callback to routing API
batman-adv: handle routing code initialization properly
batman-adv: refactoring API: find generalized name for bat_ogm_init_primary callback
batman-adv: rename BATMAN_OGM_LEN to BATMAN_OGM_HLEN
batman-adv: mark existing ogm variables as batman iv
batman-adv: introduce is_single_hop_neigh variable to increase readability
batman-adv: introduce packet type handler array for incoming packets
batman-adv: register batman ogm receive function during protocol init
batman-adv: rename last_valid to last_seen
batman-adv: replace HZ calculations with jiffies_to_msecs()
batman-adv: split neigh_new function into generic and batman iv specific parts
batman-adv: ignore protocol packets if the interface did not enable this protocol
batman-adv: refactoring API: find generalized name for bat_ogm_update_mac callback
batman-adv: rename sysfs macros to reflect the soft-interface dependency
batman-adv: avoid temporary routing loops by being strict on forwarded OGMs
batman-adv: fix checkpatch string complaint
batman-adv: prepare lq_update_lock to be shared among different protocols
batman-adv: refactor window_protected to avoid unnecessary return statement
Simon Wunderlich (10):
batman-adv: remove old bridge loop avoidance code
batman-adv: add basic bridge loop avoidance code
batman-adv: make bridge loop avoidance switchable
batman-adv: export claim tables through debugfs
batman-adv: allow multiple entries in tt_global_entries
batman-adv: don't let backbone gateways exchange tt entries
batman-adv: add broadcast duplicate check
batman-adv: drop STP over batman
batman-adv: form groups in the bridge loop avoidance
batman-adv: add bridge loop avoidance compile option
Sven Eckelmann (4):
batman-adv: Replace bitarray operations with bitmap
batman-adv: Remove declaration of only locally used functions
batman-adv: use shorter pr_warn instead of pr_warning
batman-adv: Start new development cycle
-----------------------------------------------------------------------
--
linux integration
10 years, 1 month