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@davemloft.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
This commit is contained in:
Родитель
5853e22c58
Коммит
0f5f932268
|
@ -903,9 +903,9 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
|
||||||
set_mark = 0;
|
set_mark = 0;
|
||||||
|
|
||||||
/* if the window moved, set the update flag. */
|
/* if the window moved, set the update flag. */
|
||||||
need_update |= bit_get_packet(bat_priv,
|
need_update |= batadv_bit_get_packet(bat_priv,
|
||||||
tmp_neigh_node->real_bits,
|
tmp_neigh_node->real_bits,
|
||||||
seq_diff, set_mark);
|
seq_diff, set_mark);
|
||||||
|
|
||||||
tmp_neigh_node->real_packet_count =
|
tmp_neigh_node->real_packet_count =
|
||||||
bitmap_weight(tmp_neigh_node->real_bits,
|
bitmap_weight(tmp_neigh_node->real_bits,
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include <linux/bitops.h>
|
#include <linux/bitops.h>
|
||||||
|
|
||||||
/* shift the packet array by n places. */
|
/* 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)
|
if (n <= 0 || n >= TQ_LOCAL_WINDOW_SIZE)
|
||||||
return;
|
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)
|
* 1 if the window was moved (either new or very old)
|
||||||
* 0 if the window was not moved/shifted.
|
* 0 if the window was not moved/shifted.
|
||||||
*/
|
*/
|
||||||
int bit_get_packet(void *priv, unsigned long *seq_bits,
|
int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
|
||||||
int32_t seq_num_diff, int set_mark)
|
int32_t seq_num_diff, int set_mark)
|
||||||
{
|
{
|
||||||
struct bat_priv *bat_priv = priv;
|
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 */
|
* set the mark if required */
|
||||||
|
|
||||||
if ((seq_num_diff > 0) && (seq_num_diff < TQ_LOCAL_WINDOW_SIZE)) {
|
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)
|
if (set_mark)
|
||||||
bat_set_bit(seq_bits, 0);
|
bat_set_bit(seq_bits, 0);
|
||||||
|
|
|
@ -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
|
/* receive and process one packet, returns 1 if received seq_num is considered
|
||||||
* new, 0 if old */
|
* new, 0 if old */
|
||||||
int bit_get_packet(void *priv, unsigned long *seq_bits,
|
int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
|
||||||
int32_t seq_num_diff, int set_mark);
|
int32_t seq_num_diff, int set_mark);
|
||||||
|
|
||||||
#endif /* _NET_BATMAN_ADV_BITARRAY_H_ */
|
#endif /* _NET_BATMAN_ADV_BITARRAY_H_ */
|
||||||
|
|
|
@ -54,7 +54,7 @@ void slide_own_bcast_window(struct hard_iface *hard_iface)
|
||||||
word_index = hard_iface->if_num * NUM_WORDS;
|
word_index = hard_iface->if_num * NUM_WORDS;
|
||||||
word = &(orig_node->bcast_own[word_index]);
|
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] =
|
orig_node->bcast_own_sum[hard_iface->if_num] =
|
||||||
bitmap_weight(word, TQ_LOCAL_WINDOW_SIZE);
|
bitmap_weight(word, TQ_LOCAL_WINDOW_SIZE);
|
||||||
spin_unlock_bh(&orig_node->ogm_cnt_lock);
|
spin_unlock_bh(&orig_node->ogm_cnt_lock);
|
||||||
|
@ -1083,7 +1083,7 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
|
||||||
|
|
||||||
/* mark broadcast in flood history, update window position
|
/* mark broadcast in flood history, update window position
|
||||||
* if required. */
|
* 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);
|
orig_node->last_bcast_seqno = ntohl(bcast_packet->seqno);
|
||||||
|
|
||||||
spin_unlock_bh(&orig_node->bcast_seqno_lock);
|
spin_unlock_bh(&orig_node->bcast_seqno_lock);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче