Commit 1eda58bf authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Antonio Quartulli

batman-adv: Prefix main static inline functions with batadv_

All non-static symbols of batman-adv were prefixed with batadv_ to avoid
collisions with other symbols of the kernel. Other symbols of batman-adv
should use the same prefix to keep the naming scheme consistent.
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
parent f0530ee5
This diff is collapsed.
...@@ -730,7 +730,7 @@ int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type, ...@@ -730,7 +730,7 @@ int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type,
batadv_hardif_free_ref(primary_if); batadv_hardif_free_ref(primary_if);
if (ret) if (ret)
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Impossible to send uevent for (%s,%s,%s) event (err: %d)\n", "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n",
uev_type_str[type], uev_action_str[action], uev_type_str[type], uev_action_str[action],
(action == UEV_DEL ? "NULL" : data), ret); (action == UEV_DEL ? "NULL" : data), ret);
......
...@@ -66,7 +66,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, ...@@ -66,7 +66,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
/* sequence number is much newer, probably missed a lot of packets */ /* sequence number is much newer, probably missed a lot of packets */
if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE) && if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE) &&
(seq_num_diff < EXPECTED_SEQNO_RANGE)) { (seq_num_diff < EXPECTED_SEQNO_RANGE)) {
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"We missed a lot of packets (%i) !\n", "We missed a lot of packets (%i) !\n",
seq_num_diff - 1); seq_num_diff - 1);
bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE); bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE);
...@@ -83,7 +83,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, ...@@ -83,7 +83,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) || if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) ||
(seq_num_diff >= EXPECTED_SEQNO_RANGE)) { (seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Other host probably restarted!\n"); "Other host probably restarted!\n");
bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE); bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE);
......
This diff is collapsed.
...@@ -217,20 +217,20 @@ void batadv_gw_election(struct bat_priv *bat_priv) ...@@ -217,20 +217,20 @@ void batadv_gw_election(struct bat_priv *bat_priv)
} }
if ((curr_gw) && (!next_gw)) { if ((curr_gw) && (!next_gw)) {
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Removing selected gateway - no gateway in range\n"); "Removing selected gateway - no gateway in range\n");
batadv_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)) { } else if ((!curr_gw) && (next_gw)) {
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Adding route to gateway %pM (gw_flags: %i, tq: %i)\n", "Adding route to gateway %pM (gw_flags: %i, tq: %i)\n",
next_gw->orig_node->orig, next_gw->orig_node->gw_flags, next_gw->orig_node->orig,
router->tq_avg); next_gw->orig_node->gw_flags, router->tq_avg);
batadv_throw_uevent(bat_priv, UEV_GW, UEV_ADD, gw_addr); batadv_throw_uevent(bat_priv, UEV_GW, UEV_ADD, gw_addr);
} else { } else {
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Changing route to gateway %pM (gw_flags: %i, tq: %i)\n", "Changing route to gateway %pM (gw_flags: %i, tq: %i)\n",
next_gw->orig_node->orig, next_gw->orig_node->gw_flags, next_gw->orig_node->orig,
router->tq_avg); next_gw->orig_node->gw_flags, router->tq_avg);
batadv_throw_uevent(bat_priv, UEV_GW, UEV_CHANGE, gw_addr); batadv_throw_uevent(bat_priv, UEV_GW, UEV_CHANGE, gw_addr);
} }
...@@ -282,7 +282,7 @@ void batadv_gw_check_election(struct bat_priv *bat_priv, ...@@ -282,7 +282,7 @@ void batadv_gw_check_election(struct bat_priv *bat_priv,
(orig_tq_avg - gw_tq_avg < atomic_read(&bat_priv->gw_sel_class))) (orig_tq_avg - gw_tq_avg < atomic_read(&bat_priv->gw_sel_class)))
goto out; goto out;
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Restarting gateway selection: better gateway found (tq curr: %i, tq new: %i)\n", "Restarting gateway selection: better gateway found (tq curr: %i, tq new: %i)\n",
gw_tq_avg, orig_tq_avg); gw_tq_avg, orig_tq_avg);
...@@ -318,7 +318,7 @@ static void gw_node_add(struct bat_priv *bat_priv, ...@@ -318,7 +318,7 @@ static void gw_node_add(struct bat_priv *bat_priv,
spin_unlock_bh(&bat_priv->gw_list_lock); spin_unlock_bh(&bat_priv->gw_list_lock);
batadv_gw_bandwidth_to_kbit(new_gwflags, &down, &up); batadv_gw_bandwidth_to_kbit(new_gwflags, &down, &up);
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Found new gateway %pM -> gw_class: %i - %i%s/%i%s\n", "Found new gateway %pM -> gw_class: %i - %i%s/%i%s\n",
orig_node->orig, new_gwflags, orig_node->orig, new_gwflags,
(down > 2048 ? down / 1024 : down), (down > 2048 ? down / 1024 : down),
...@@ -345,7 +345,7 @@ void batadv_gw_node_update(struct bat_priv *bat_priv, ...@@ -345,7 +345,7 @@ void batadv_gw_node_update(struct bat_priv *bat_priv,
if (gw_node->orig_node != orig_node) if (gw_node->orig_node != orig_node)
continue; continue;
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Gateway class of originator %pM changed from %i to %i\n", "Gateway class of originator %pM changed from %i to %i\n",
orig_node->orig, gw_node->orig_node->gw_flags, orig_node->orig, gw_node->orig_node->gw_flags,
new_gwflags); new_gwflags);
...@@ -354,7 +354,7 @@ void batadv_gw_node_update(struct bat_priv *bat_priv, ...@@ -354,7 +354,7 @@ void batadv_gw_node_update(struct bat_priv *bat_priv,
if (new_gwflags == NO_FLAGS) { if (new_gwflags == NO_FLAGS) {
gw_node->deleted = jiffies; gw_node->deleted = jiffies;
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Gateway %pM removed from gateway list\n", "Gateway %pM removed from gateway list\n",
orig_node->orig); orig_node->orig);
......
...@@ -163,7 +163,7 @@ static void check_known_mac_addr(const struct net_device *net_dev) ...@@ -163,7 +163,7 @@ static void check_known_mac_addr(const struct net_device *net_dev)
if (hard_iface->net_dev == net_dev) if (hard_iface->net_dev == net_dev)
continue; continue;
if (!compare_eth(hard_iface->net_dev->dev_addr, if (!batadv_compare_eth(hard_iface->net_dev->dev_addr,
net_dev->dev_addr)) net_dev->dev_addr))
continue; continue;
......
...@@ -158,7 +158,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff, ...@@ -158,7 +158,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
size_t packet_len = sizeof(struct icmp_packet); size_t packet_len = sizeof(struct icmp_packet);
if (len < sizeof(struct icmp_packet)) { if (len < sizeof(struct icmp_packet)) {
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Error - can't send packet from char device: invalid packet size\n"); "Error - can't send packet from char device: invalid packet size\n");
return -EINVAL; return -EINVAL;
} }
...@@ -188,14 +188,14 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff, ...@@ -188,14 +188,14 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
} }
if (icmp_packet->header.packet_type != BAT_ICMP) { if (icmp_packet->header.packet_type != BAT_ICMP) {
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Error - can't send packet from char device: got bogus packet type (expected: BAT_ICMP)\n"); "Error - can't send packet from char device: got bogus packet type (expected: BAT_ICMP)\n");
len = -EINVAL; len = -EINVAL;
goto free_skb; goto free_skb;
} }
if (icmp_packet->msg_type != ECHO_REQUEST) { if (icmp_packet->msg_type != ECHO_REQUEST) {
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Error - can't send packet from char device: got bogus message type (expected: ECHO_REQUEST)\n"); "Error - can't send packet from char device: got bogus message type (expected: ECHO_REQUEST)\n");
len = -EINVAL; len = -EINVAL;
goto free_skb; goto free_skb;
......
...@@ -180,7 +180,7 @@ int batadv_is_my_mac(const uint8_t *addr) ...@@ -180,7 +180,7 @@ int batadv_is_my_mac(const uint8_t *addr)
if (hard_iface->if_status != IF_ACTIVE) if (hard_iface->if_status != IF_ACTIVE)
continue; continue;
if (compare_eth(hard_iface->net_dev->dev_addr, addr)) { if (batadv_compare_eth(hard_iface->net_dev->dev_addr, addr)) {
rcu_read_unlock(); rcu_read_unlock();
return 1; return 1;
} }
...@@ -238,7 +238,7 @@ int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev, ...@@ -238,7 +238,7 @@ int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
batman_ogm_packet = (struct batman_ogm_packet *)skb->data; batman_ogm_packet = (struct batman_ogm_packet *)skb->data;
if (batman_ogm_packet->header.version != COMPAT_VERSION) { if (batman_ogm_packet->header.version != COMPAT_VERSION) {
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Drop packet: incompatible batman version (%i)\n", "Drop packet: incompatible batman version (%i)\n",
batman_ogm_packet->header.version); batman_ogm_packet->header.version);
goto err_free; goto err_free;
......
...@@ -175,7 +175,7 @@ int batadv_algo_seq_print_text(struct seq_file *seq, void *offset); ...@@ -175,7 +175,7 @@ int batadv_algo_seq_print_text(struct seq_file *seq, void *offset);
int batadv_debug_log(struct bat_priv *bat_priv, const char *fmt, ...) int batadv_debug_log(struct bat_priv *bat_priv, const char *fmt, ...)
__printf(2, 3); __printf(2, 3);
#define bat_dbg(type, bat_priv, fmt, arg...) \ #define batadv_dbg(type, bat_priv, fmt, arg...) \
do { \ do { \
if (atomic_read(&bat_priv->log_level) & type) \ if (atomic_read(&bat_priv->log_level) & type) \
batadv_debug_log(bat_priv, fmt, ## arg);\ batadv_debug_log(bat_priv, fmt, ## arg);\
...@@ -183,7 +183,7 @@ __printf(2, 3); ...@@ -183,7 +183,7 @@ __printf(2, 3);
while (0) while (0)
#else /* !CONFIG_BATMAN_ADV_DEBUG */ #else /* !CONFIG_BATMAN_ADV_DEBUG */
__printf(3, 4) __printf(3, 4)
static inline void bat_dbg(int type __always_unused, static inline void batadv_dbg(int type __always_unused,
struct bat_priv *bat_priv __always_unused, struct bat_priv *bat_priv __always_unused,
const char *fmt __always_unused, ...) const char *fmt __always_unused, ...)
{ {
...@@ -194,14 +194,14 @@ static inline void bat_dbg(int type __always_unused, ...@@ -194,14 +194,14 @@ static inline void bat_dbg(int type __always_unused,
do { \ do { \
struct net_device *_netdev = (net_dev); \ struct net_device *_netdev = (net_dev); \
struct bat_priv *_batpriv = netdev_priv(_netdev); \ struct bat_priv *_batpriv = netdev_priv(_netdev); \
bat_dbg(DBG_ALL, _batpriv, fmt, ## arg); \ batadv_dbg(DBG_ALL, _batpriv, fmt, ## arg); \
pr_info("%s: " fmt, _netdev->name, ## arg); \ pr_info("%s: " fmt, _netdev->name, ## arg); \
} while (0) } while (0)
#define bat_err(net_dev, fmt, arg...) \ #define bat_err(net_dev, fmt, arg...) \
do { \ do { \
struct net_device *_netdev = (net_dev); \ struct net_device *_netdev = (net_dev); \
struct bat_priv *_batpriv = netdev_priv(_netdev); \ struct bat_priv *_batpriv = netdev_priv(_netdev); \
bat_dbg(DBG_ALL, _batpriv, fmt, ## arg); \ batadv_dbg(DBG_ALL, _batpriv, fmt, ## arg); \
pr_err("%s: " fmt, _netdev->name, ## arg); \ pr_err("%s: " fmt, _netdev->name, ## arg); \
} while (0) } while (0)
...@@ -209,7 +209,7 @@ static inline void bat_dbg(int type __always_unused, ...@@ -209,7 +209,7 @@ static inline void bat_dbg(int type __always_unused,
* *
* note: can't use compare_ether_addr() as it requires aligned memory * note: can't use compare_ether_addr() as it requires aligned memory
*/ */
static inline int compare_eth(const void *data1, const void *data2) static inline int batadv_compare_eth(const void *data1, const void *data2)
{ {
return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0); return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
} }
...@@ -220,7 +220,8 @@ static inline int compare_eth(const void *data1, const void *data2) ...@@ -220,7 +220,8 @@ static inline int compare_eth(const void *data1, const void *data2)
* *
* Returns true if current time is after timestamp + timeout * Returns true if current time is after timestamp + timeout
*/ */
static inline bool has_timed_out(unsigned long timestamp, unsigned int timeout) static inline bool batadv_has_timed_out(unsigned long timestamp,
unsigned int timeout)
{ {
return time_is_before_jiffies(timestamp + msecs_to_jiffies(timeout)); return time_is_before_jiffies(timestamp + msecs_to_jiffies(timeout));
} }
......
...@@ -102,7 +102,7 @@ struct neigh_node *batadv_neigh_node_new(struct hard_iface *hard_iface, ...@@ -102,7 +102,7 @@ struct neigh_node *batadv_neigh_node_new(struct hard_iface *hard_iface,
/* extra reference for return */ /* extra reference for return */
atomic_set(&neigh_node->refcount, 2); atomic_set(&neigh_node->refcount, 2);
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Creating new neighbor %pM, initial seqno %d\n", "Creating new neighbor %pM, initial seqno %d\n",
neigh_addr, seqno); neigh_addr, seqno);
...@@ -199,8 +199,8 @@ struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv, ...@@ -199,8 +199,8 @@ struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv,
if (orig_node) if (orig_node)
return orig_node; return orig_node;
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv, "Creating new originator: %pM\n",
"Creating new originator: %pM\n", addr); addr);
orig_node = kzalloc(sizeof(*orig_node), GFP_ATOMIC); orig_node = kzalloc(sizeof(*orig_node), GFP_ATOMIC);
if (!orig_node) if (!orig_node)
...@@ -272,6 +272,7 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv, ...@@ -272,6 +272,7 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv,
struct neigh_node *neigh_node; struct neigh_node *neigh_node;
bool neigh_purged = false; bool neigh_purged = false;
unsigned long last_seen; unsigned long last_seen;
struct hard_iface *if_incoming;
*best_neigh_node = NULL; *best_neigh_node = NULL;
...@@ -281,25 +282,23 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv, ...@@ -281,25 +282,23 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv,
hlist_for_each_entry_safe(neigh_node, node, node_tmp, hlist_for_each_entry_safe(neigh_node, node, node_tmp,
&orig_node->neigh_list, list) { &orig_node->neigh_list, list) {
if ((has_timed_out(neigh_node->last_seen, PURGE_TIMEOUT)) ||
(neigh_node->if_incoming->if_status == IF_INACTIVE) ||
(neigh_node->if_incoming->if_status == IF_NOT_IN_USE) ||
(neigh_node->if_incoming->if_status == IF_TO_BE_REMOVED)) {
last_seen = neigh_node->last_seen; last_seen = neigh_node->last_seen;
if_incoming = neigh_node->if_incoming;
if ((batadv_has_timed_out(last_seen, PURGE_TIMEOUT)) ||
(if_incoming->if_status == IF_INACTIVE) ||
(if_incoming->if_status == IF_NOT_IN_USE) ||
(if_incoming->if_status == IF_TO_BE_REMOVED)) {
if ((neigh_node->if_incoming->if_status == if ((if_incoming->if_status == IF_INACTIVE) ||
IF_INACTIVE) || (if_incoming->if_status == IF_NOT_IN_USE) ||
(neigh_node->if_incoming->if_status == (if_incoming->if_status == IF_TO_BE_REMOVED))
IF_NOT_IN_USE) || batadv_dbg(DBG_BATMAN, bat_priv,
(neigh_node->if_incoming->if_status ==
IF_TO_BE_REMOVED))
bat_dbg(DBG_BATMAN, bat_priv,
"neighbor purge: originator %pM, neighbor: %pM, iface: %s\n", "neighbor purge: originator %pM, neighbor: %pM, iface: %s\n",
orig_node->orig, neigh_node->addr, orig_node->orig, neigh_node->addr,
neigh_node->if_incoming->net_dev->name); if_incoming->net_dev->name);
else else
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"neighbor timeout: originator %pM, neighbor: %pM, last_seen: %u\n", "neighbor timeout: originator %pM, neighbor: %pM, last_seen: %u\n",
orig_node->orig, neigh_node->addr, orig_node->orig, neigh_node->addr,
jiffies_to_msecs(last_seen)); jiffies_to_msecs(last_seen));
...@@ -325,8 +324,8 @@ static bool purge_orig_node(struct bat_priv *bat_priv, ...@@ -325,8 +324,8 @@ static bool purge_orig_node(struct bat_priv *bat_priv,
{ {
struct neigh_node *best_neigh_node; struct neigh_node *best_neigh_node;
if (has_timed_out(orig_node->last_seen, 2 * PURGE_TIMEOUT)) { if (batadv_has_timed_out(orig_node->last_seen, 2 * PURGE_TIMEOUT)) {
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"Originator timeout: originator %pM, last_seen %u\n", "Originator timeout: originator %pM, last_seen %u\n",
orig_node->orig, orig_node->orig,
jiffies_to_msecs(orig_node->last_seen)); jiffies_to_msecs(orig_node->last_seen));
...@@ -370,7 +369,7 @@ static void _purge_orig(struct bat_priv *bat_priv) ...@@ -370,7 +369,7 @@ static void _purge_orig(struct bat_priv *bat_priv)
continue; continue;
} }
if (has_timed_out(orig_node->last_frag_packet, if (batadv_has_timed_out(orig_node->last_frag_packet,
FRAG_TIMEOUT)) FRAG_TIMEOUT))
batadv_frag_list_free(&orig_node->frag_list); batadv_frag_list_free(&orig_node->frag_list);
} }
......
...@@ -77,7 +77,7 @@ static inline struct orig_node *batadv_orig_hash_find(struct bat_priv *bat_priv, ...@@ -77,7 +77,7 @@ static inline struct orig_node *batadv_orig_hash_find(struct bat_priv *bat_priv,
rcu_read_lock(); rcu_read_lock();
hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) {
if (!compare_eth(orig_node, data)) if (!batadv_compare_eth(orig_node, data))
continue; continue;
if (!atomic_inc_not_zero(&orig_node->refcount)) if (!atomic_inc_not_zero(&orig_node->refcount))
......
...@@ -71,7 +71,7 @@ static void _update_route(struct bat_priv *bat_priv, ...@@ -71,7 +71,7 @@ static void _update_route(struct bat_priv *bat_priv,
/* route deleted */ /* route deleted */
if ((curr_router) && (!neigh_node)) { if ((curr_router) && (!neigh_node)) {
bat_dbg(DBG_ROUTES, bat_priv, "Deleting route towards: %pM\n", batadv_dbg(DBG_ROUTES, bat_priv, "Deleting route towards: %pM\n",
orig_node->orig); orig_node->orig);
batadv_tt_global_del_orig(bat_priv, orig_node, batadv_tt_global_del_orig(bat_priv, orig_node,
"Deleted route towards originator"); "Deleted route towards originator");
...@@ -79,12 +79,12 @@ static void _update_route(struct bat_priv *bat_priv, ...@@ -79,12 +79,12 @@ static void _update_route(struct bat_priv *bat_priv,
/* route added */ /* route added */
} else if ((!curr_router) && (neigh_node)) { } else if ((!curr_router) && (neigh_node)) {
bat_dbg(DBG_ROUTES, bat_priv, batadv_dbg(DBG_ROUTES, bat_priv,
"Adding route towards: %pM (via %pM)\n", "Adding route towards: %pM (via %pM)\n",
orig_node->orig, neigh_node->addr); orig_node->orig, neigh_node->addr);
/* route changed */ /* route changed */
} else if (neigh_node && curr_router) { } else if (neigh_node && curr_router) {
bat_dbg(DBG_ROUTES, bat_priv, batadv_dbg(DBG_ROUTES, bat_priv,
"Changing route towards: %pM (now via %pM - was via %pM)\n", "Changing route towards: %pM (now via %pM - was via %pM)\n",
orig_node->orig, neigh_node->addr, orig_node->orig, neigh_node->addr,
curr_router->addr); curr_router->addr);
...@@ -151,7 +151,7 @@ void batadv_bonding_candidate_add(struct orig_node *orig_node, ...@@ -151,7 +151,7 @@ void batadv_bonding_candidate_add(struct orig_node *orig_node,
spin_lock_bh(&orig_node->neigh_list_lock); spin_lock_bh(&orig_node->neigh_list_lock);
/* only consider if it has the same primary address ... */ /* only consider if it has the same primary address ... */
if (!compare_eth(orig_node->orig, if (!batadv_compare_eth(orig_node->orig,
neigh_node->orig_node->primary_addr)) neigh_node->orig_node->primary_addr))
goto candidate_del; goto candidate_del;
...@@ -180,7 +180,8 @@ void batadv_bonding_candidate_add(struct orig_node *orig_node, ...@@ -180,7 +180,8 @@ void batadv_bonding_candidate_add(struct orig_node *orig_node,
continue; continue;
if ((neigh_node->if_incoming == tmp_neigh_node->if_incoming) || if ((neigh_node->if_incoming == tmp_neigh_node->if_incoming) ||
(compare_eth(neigh_node->addr, tmp_neigh_node->addr))) { (batadv_compare_eth(neigh_node->addr,
tmp_neigh_node->addr))) {
interference_candidate = 1; interference_candidate = 1;
break; break;
} }
...@@ -233,11 +234,11 @@ int batadv_window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff, ...@@ -233,11 +234,11 @@ int batadv_window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff,
{ {
if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) || if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) ||
(seq_num_diff >= EXPECTED_SEQNO_RANGE)) { (seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
if (!has_timed_out(*last_reset, RESET_PROTECTION_MS)) if (!batadv_has_timed_out(*last_reset, RESET_PROTECTION_MS))
return 1; return 1;
*last_reset = jiffies; *last_reset = jiffies;
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"old packet received, start protection\n"); "old packet received, start protection\n");
} }
...@@ -578,6 +579,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if) ...@@ -578,6 +579,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
struct tt_query_packet *tt_query; struct tt_query_packet *tt_query;
uint16_t tt_size; uint16_t tt_size;
struct ethhdr *ethhdr; struct ethhdr *ethhdr;
char tt_flag;
/* drop packet if it has not necessary minimum size */ /* drop packet if it has not necessary minimum size */
if (unlikely(!pskb_may_pull(skb, sizeof(struct tt_query_packet)))) if (unlikely(!pskb_may_pull(skb, sizeof(struct tt_query_packet))))
...@@ -607,10 +609,11 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if) ...@@ -607,10 +609,11 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
* forwarded * forwarded
*/ */
if (!batadv_send_tt_response(bat_priv, tt_query)) { if (!batadv_send_tt_response(bat_priv, tt_query)) {
bat_dbg(DBG_TT, bat_priv, tt_flag = tt_query->flags & TT_FULL_TABLE ? 'F' : '.';
batadv_dbg(DBG_TT, bat_priv,
"Routing TT_REQUEST to %pM [%c]\n", "Routing TT_REQUEST to %pM [%c]\n",
tt_query->dst, tt_query->dst,
(tt_query->flags & TT_FULL_TABLE ? 'F' : '.')); tt_flag);
return route_unicast_packet(skb, recv_if); return route_unicast_packet(skb, recv_if);
} }
break; break;
...@@ -635,10 +638,11 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if) ...@@ -635,10 +638,11 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
batadv_handle_tt_response(bat_priv, tt_query); batadv_handle_tt_response(bat_priv, tt_query);
} else { } else {
bat_dbg(DBG_TT, bat_priv, tt_flag = tt_query->flags & TT_FULL_TABLE ? 'F' : '.';
batadv_dbg(DBG_TT, bat_priv,
"Routing TT_RESPONSE to %pM [%c]\n", "Routing TT_RESPONSE to %pM [%c]\n",
tt_query->dst, tt_query->dst,
(tt_query->flags & TT_FULL_TABLE ? 'F' : '.')); tt_flag);
return route_unicast_packet(skb, recv_if); return route_unicast_packet(skb, recv_if);
} }
break; break;
...@@ -688,7 +692,7 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if) ...@@ -688,7 +692,7 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
if (!orig_node) if (!orig_node)
goto out; goto out;
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Received ROAMING_ADV from %pM (client %pM)\n", "Received ROAMING_ADV from %pM (client %pM)\n",
roam_adv_packet->src, roam_adv_packet->client); roam_adv_packet->src, roam_adv_packet->client);
...@@ -749,13 +753,13 @@ struct neigh_node *batadv_find_router(struct bat_priv *bat_priv, ...@@ -749,13 +753,13 @@ struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
/* if we have something in the primary_addr, we can search /* if we have something in the primary_addr, we can search
* for a potential bonding candidate. * for a potential bonding candidate.
*/ */
if (compare_eth(primary_addr, zero_mac)) if (batadv_compare_eth(primary_addr, zero_mac))
goto return_router; goto return_router;
/* find the orig_node which has the primary interface. might /* find the orig_node which has the primary interface. might
* even be the same as our router_orig in many cases * even be the same as our router_orig in many cases
*/ */
if (compare_eth(primary_addr, router_orig->orig)) { if (batadv_compare_eth(primary_addr, router_orig->orig)) {
primary_orig_node = router_orig; primary_orig_node = router_orig;
} else { } else {
primary_orig_node = batadv_orig_hash_find(bat_priv, primary_orig_node = batadv_orig_hash_find(bat_priv,
...@@ -974,7 +978,7 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv, ...@@ -974,7 +978,7 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv,
batadv_orig_node_free_ref(orig_node); batadv_orig_node_free_ref(orig_node);
} }
bat_dbg(DBG_ROUTES, bat_priv, batadv_dbg(DBG_ROUTES, bat_priv,
"TTVN mismatch (old_ttvn %u new_ttvn %u)! Rerouting unicast packet (for %pM) to %pM\n", "TTVN mismatch (old_ttvn %u new_ttvn %u)! Rerouting unicast packet (for %pM) to %pM\n",
unicast_packet->ttvn, curr_ttvn, ethhdr->h_dest, unicast_packet->ttvn, curr_ttvn, ethhdr->h_dest,
unicast_packet->dest); unicast_packet->dest);
......
...@@ -142,7 +142,7 @@ int batadv_add_bcast_packet_to_list(struct bat_priv *bat_priv, ...@@ -142,7 +142,7 @@ int batadv_add_bcast_packet_to_list(struct bat_priv *bat_priv,
struct sk_buff *newskb; struct sk_buff *newskb;
if (!atomic_dec_not_zero(&bat_priv->bcast_queue_left)) { if (!atomic_dec_not_zero(&bat_priv->bcast_queue_left)) {
bat_dbg(DBG_BATMAN, bat_priv, "bcast packet queue full\n"); batadv_dbg(DBG_BATMAN, bat_priv, "bcast packet queue full\n");
goto out; goto out;
} }
...@@ -271,11 +271,11 @@ void batadv_purge_outstanding_packets(struct bat_priv *bat_priv, ...@@ -271,11 +271,11 @@ void batadv_purge_outstanding_packets(struct bat_priv *bat_priv,
bool pending; bool pending;
if (hard_iface) if (hard_iface)
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"purge_outstanding_packets(): %s\n", "purge_outstanding_packets(): %s\n",
hard_iface->net_dev->name); hard_iface->net_dev->name);
else else
bat_dbg(DBG_BATMAN, bat_priv, batadv_dbg(DBG_BATMAN, bat_priv,
"purge_outstanding_packets()\n"); "purge_outstanding_packets()\n");
/* free bcast list */ /* free bcast list */
......
...@@ -168,7 +168,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface) ...@@ -168,7 +168,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
/* don't accept stp packets. STP does not help in meshes. /* don't accept stp packets. STP does not help in meshes.
* better use the bridge loop avoidance ... * better use the bridge loop avoidance ...
*/ */
if (compare_eth(ethhdr->h_dest, stp_addr)) if (batadv_compare_eth(ethhdr->h_dest, stp_addr))
goto dropped; goto dropped;
if (is_multicast_ether_addr(ethhdr->h_dest)) { if (is_multicast_ether_addr(ethhdr->h_dest)) {
......
...@@ -66,7 +66,7 @@ static struct tt_common_entry *tt_hash_find(struct hashtable_t *hash, ...@@ -66,7 +66,7 @@ static struct tt_common_entry *tt_hash_find(struct hashtable_t *hash,
rcu_read_lock(); rcu_read_lock();
hlist_for_each_entry_rcu(tt_common_entry, node, head, hash_entry) { hlist_for_each_entry_rcu(tt_common_entry, node, head, hash_entry) {
if (!compare_eth(tt_common_entry, data)) if (!batadv_compare_eth(tt_common_entry, data))
continue; continue;
if (!atomic_inc_not_zero(&tt_common_entry->refcount)) if (!atomic_inc_not_zero(&tt_common_entry->refcount))
...@@ -213,7 +213,7 @@ void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr, ...@@ -213,7 +213,7 @@ void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
if (!tt_local_entry) if (!tt_local_entry)
goto out; goto out;
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Creating new local tt entry: %pM (ttvn: %d)\n", addr, "Creating new local tt entry: %pM (ttvn: %d)\n", addr,
(uint8_t)atomic_read(&bat_priv->ttvn)); (uint8_t)atomic_read(&bat_priv->ttvn));
...@@ -225,7 +225,7 @@ void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr, ...@@ -225,7 +225,7 @@ void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
tt_local_entry->last_seen = jiffies; tt_local_entry->last_seen = jiffies;
/* the batman interface mac address should never be purged */ /* the batman interface mac address should never be purged */
if (compare_eth(addr, soft_iface->dev_addr)) if (batadv_compare_eth(addr, soft_iface->dev_addr))
tt_local_entry->common.flags |= TT_CLIENT_NOPURGE; tt_local_entry->common.flags |= TT_CLIENT_NOPURGE;
/* The local entry has to be marked as NEW to avoid to send it in /* The local entry has to be marked as NEW to avoid to send it in
...@@ -441,7 +441,7 @@ static void tt_local_set_pending(struct bat_priv *bat_priv, ...@@ -441,7 +441,7 @@ static void tt_local_set_pending(struct bat_priv *bat_priv,
*/ */
tt_local_entry->common.flags |= TT_CLIENT_PENDING; tt_local_entry->common.flags |= TT_CLIENT_PENDING;
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Local tt entry (%pM) pending to be removed: %s\n", "Local tt entry (%pM) pending to be removed: %s\n",
tt_local_entry->common.addr, message); tt_local_entry->common.addr, message);
} }
...@@ -489,7 +489,7 @@ static void tt_local_purge(struct bat_priv *bat_priv) ...@@ -489,7 +489,7 @@ static void tt_local_purge(struct bat_priv *bat_priv)
if (tt_local_entry->common.flags & TT_CLIENT_PENDING) if (tt_local_entry->common.flags & TT_CLIENT_PENDING)
continue; continue;
if (!has_timed_out(tt_local_entry->last_seen, if (!batadv_has_timed_out(tt_local_entry->last_seen,
TT_LOCAL_TIMEOUT)) TT_LOCAL_TIMEOUT))
continue; continue;
...@@ -674,7 +674,7 @@ int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node, ...@@ -674,7 +674,7 @@ int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
if (wifi) if (wifi)
tt_global_entry->common.flags |= TT_CLIENT_WIFI; tt_global_entry->common.flags |= TT_CLIENT_WIFI;
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Creating new global tt entry: %pM (via %pM)\n", "Creating new global tt entry: %pM (via %pM)\n",
tt_global_entry->common.addr, orig_node->orig); tt_global_entry->common.addr, orig_node->orig);
...@@ -800,10 +800,10 @@ static void tt_global_del_orig_entry(struct bat_priv *bat_priv, ...@@ -800,10 +800,10 @@ static void tt_global_del_orig_entry(struct bat_priv *bat_priv,
head = &tt_global_entry->orig_list; head = &tt_global_entry->orig_list;
hlist_for_each_entry_safe(orig_entry, node, safe, head, list) { hlist_for_each_entry_safe(orig_entry, node, safe, head, list) {
if (orig_entry->orig_node == orig_node) { if (orig_entry->orig_node == orig_node) {
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Deleting %pM from global tt entry %pM: %s\n", "Deleting %pM from global tt entry %pM: %s\n",
orig_node->orig, tt_global_entry->common.addr, orig_node->orig,
message); tt_global_entry->common.addr, message);
hlist_del_rcu(node); hlist_del_rcu(node);
tt_orig_list_entry_free_ref(orig_entry); tt_orig_list_entry_free_ref(orig_entry);
} }
...@@ -815,8 +815,7 @@ static void tt_global_del_struct(struct bat_priv *bat_priv, ...@@ -815,8 +815,7 @@ static void tt_global_del_struct(struct bat_priv *bat_priv,
struct tt_global_entry *tt_global_entry, struct tt_global_entry *tt_global_entry,
const char *message) const char *message)
{ {
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv, "Deleting global tt entry %pM: %s\n",
"Deleting global tt entry %pM: %s\n",
tt_global_entry->common.addr, message); tt_global_entry->common.addr, message);
batadv_hash_remove(bat_priv->tt_global_hash, compare_tt, batadv_hash_remove(bat_priv->tt_global_hash, compare_tt,
...@@ -951,7 +950,7 @@ void batadv_tt_global_del_orig(struct bat_priv *bat_priv, ...@@ -951,7 +950,7 @@ void batadv_tt_global_del_orig(struct bat_priv *bat_priv,
orig_node, message); orig_node, message);
if (hlist_empty(&tt_global_entry->orig_list)) { if (hlist_empty(&tt_global_entry->orig_list)) {
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Deleting global tt entry %pM: %s\n", "Deleting global tt entry %pM: %s\n",
tt_global_entry->common.addr, tt_global_entry->common.addr,
message); message);
...@@ -987,11 +986,11 @@ static void tt_global_roam_purge(struct bat_priv *bat_priv) ...@@ -987,11 +986,11 @@ static void tt_global_roam_purge(struct bat_priv *bat_priv)
common); common);
if (!(tt_global_entry->common.flags & TT_CLIENT_ROAM)) if (!(tt_global_entry->common.flags & TT_CLIENT_ROAM))
continue; continue;
if (!has_timed_out(tt_global_entry->roam_at, if (!batadv_has_timed_out(tt_global_entry->roam_at,
TT_CLIENT_ROAM_TIMEOUT)) TT_CLIENT_ROAM_TIMEOUT))
continue; continue;
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Deleting global tt entry (%pM): Roaming timeout\n", "Deleting global tt entry (%pM): Roaming timeout\n",
tt_global_entry->common.addr); tt_global_entry->common.addr);
...@@ -1234,7 +1233,7 @@ static void tt_req_purge(struct bat_priv *bat_priv) ...@@ -1234,7 +1233,7 @@ static void tt_req_purge(struct bat_priv *bat_priv)
spin_lock_bh(&bat_priv->tt_req_list_lock); spin_lock_bh(&bat_priv->tt_req_list_lock);
list_for_each_entry_safe(node, safe, &bat_priv->tt_req_list, list) { list_for_each_entry_safe(node, safe, &bat_priv->tt_req_list, list) {
if (has_timed_out(node->issued_at, TT_REQUEST_TIMEOUT)) { if (batadv_has_timed_out(node->issued_at, TT_REQUEST_TIMEOUT)) {
list_del(&node->list); list_del(&node->list);
kfree(node); kfree(node);
} }
...@@ -1252,8 +1251,8 @@ static struct tt_req_node *new_tt_req_node(struct bat_priv *bat_priv, ...@@ -1252,8 +1251,8 @@ static struct tt_req_node *new_tt_req_node(struct bat_priv *bat_priv,
spin_lock_bh(&bat_priv->tt_req_list_lock); spin_lock_bh(&bat_priv->tt_req_list_lock);
list_for_each_entry(tt_req_node_tmp, &bat_priv->tt_req_list, list) { list_for_each_entry(tt_req_node_tmp, &bat_priv->tt_req_list, list) {
if (compare_eth(tt_req_node_tmp, orig_node) && if (batadv_compare_eth(tt_req_node_tmp, orig_node) &&
!has_timed_out(tt_req_node_tmp->issued_at, !batadv_has_timed_out(tt_req_node_tmp->issued_at,
TT_REQUEST_TIMEOUT)) TT_REQUEST_TIMEOUT))
goto unlock; goto unlock;
} }
...@@ -1409,7 +1408,7 @@ static int send_tt_request(struct bat_priv *bat_priv, ...@@ -1409,7 +1408,7 @@ static int send_tt_request(struct bat_priv *bat_priv,
if (!neigh_node) if (!neigh_node)
goto out; goto out;
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Sending TT_REQUEST to %pM via %pM [%c]\n", "Sending TT_REQUEST to %pM via %pM [%c]\n",
dst_orig_node->orig, neigh_node->addr, dst_orig_node->orig, neigh_node->addr,
(full_table ? 'F' : '.')); (full_table ? 'F' : '.'));
...@@ -1449,7 +1448,7 @@ static bool send_other_tt_response(struct bat_priv *bat_priv, ...@@ -1449,7 +1448,7 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
struct tt_query_packet *tt_response; struct tt_query_packet *tt_response;
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Received TT_REQUEST from %pM for ttvn: %u (%pM) [%c]\n", "Received TT_REQUEST from %pM for ttvn: %u (%pM) [%c]\n",
tt_request->src, tt_request->ttvn, tt_request->dst, tt_request->src, tt_request->ttvn, tt_request->dst,
(tt_request->flags & TT_FULL_TABLE ? 'F' : '.')); (tt_request->flags & TT_FULL_TABLE ? 'F' : '.'));
...@@ -1536,7 +1535,7 @@ static bool send_other_tt_response(struct bat_priv *bat_priv, ...@@ -1536,7 +1535,7 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
if (full_table) if (full_table)
tt_response->flags |= TT_FULL_TABLE; tt_response->flags |= TT_FULL_TABLE;
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Sending TT_RESPONSE %pM via %pM for %pM (ttvn: %u)\n", "Sending TT_RESPONSE %pM via %pM for %pM (ttvn: %u)\n",
res_dst_orig_node->orig, neigh_node->addr, res_dst_orig_node->orig, neigh_node->addr,
req_dst_orig_node->orig, req_ttvn); req_dst_orig_node->orig, req_ttvn);
...@@ -1578,7 +1577,7 @@ static bool send_my_tt_response(struct bat_priv *bat_priv, ...@@ -1578,7 +1577,7 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
struct tt_query_packet *tt_response; struct tt_query_packet *tt_response;
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Received TT_REQUEST from %pM for ttvn: %u (me) [%c]\n", "Received TT_REQUEST from %pM for ttvn: %u (me) [%c]\n",
tt_request->src, tt_request->ttvn, tt_request->src, tt_request->ttvn,
(tt_request->flags & TT_FULL_TABLE ? 'F' : '.')); (tt_request->flags & TT_FULL_TABLE ? 'F' : '.'));
...@@ -1656,7 +1655,7 @@ static bool send_my_tt_response(struct bat_priv *bat_priv, ...@@ -1656,7 +1655,7 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
if (full_table) if (full_table)
tt_response->flags |= TT_FULL_TABLE; tt_response->flags |= TT_FULL_TABLE;
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Sending TT_RESPONSE to %pM via %pM [%c]\n", "Sending TT_RESPONSE to %pM via %pM [%c]\n",
orig_node->orig, neigh_node->addr, orig_node->orig, neigh_node->addr,
(tt_response->flags & TT_FULL_TABLE ? 'F' : '.')); (tt_response->flags & TT_FULL_TABLE ? 'F' : '.'));
...@@ -1795,7 +1794,7 @@ void batadv_handle_tt_response(struct bat_priv *bat_priv, ...@@ -1795,7 +1794,7 @@ void batadv_handle_tt_response(struct bat_priv *bat_priv,
struct tt_req_node *node, *safe; struct tt_req_node *node, *safe;
struct orig_node *orig_node = NULL; struct orig_node *orig_node = NULL;
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Received TT_RESPONSE from %pM for ttvn %d t_size: %d [%c]\n", "Received TT_RESPONSE from %pM for ttvn %d t_size: %d [%c]\n",
tt_response->src, tt_response->ttvn, tt_response->src, tt_response->ttvn,
ntohs(tt_response->tt_data), ntohs(tt_response->tt_data),
...@@ -1820,7 +1819,7 @@ void batadv_handle_tt_response(struct bat_priv *bat_priv, ...@@ -1820,7 +1819,7 @@ void batadv_handle_tt_response(struct bat_priv *bat_priv,
/* Delete the tt_req_node from pending tt_requests list */ /* Delete the tt_req_node from pending tt_requests list */
spin_lock_bh(&bat_priv->tt_req_list_lock); spin_lock_bh(&bat_priv->tt_req_list_lock);
list_for_each_entry_safe(node, safe, &bat_priv->tt_req_list, list) { list_for_each_entry_safe(node, safe, &bat_priv->tt_req_list, list) {
if (!compare_eth(node->addr, tt_response->src)) if (!batadv_compare_eth(node->addr, tt_response->src))
continue; continue;
list_del(&node->list); list_del(&node->list);
kfree(node); kfree(node);
...@@ -1875,7 +1874,7 @@ static void tt_roam_purge(struct bat_priv *bat_priv) ...@@ -1875,7 +1874,7 @@ static void tt_roam_purge(struct bat_priv *bat_priv)
spin_lock_bh(&bat_priv->tt_roam_list_lock); spin_lock_bh(&bat_priv->tt_roam_list_lock);
list_for_each_entry_safe(node, safe, &bat_priv->tt_roam_list, list) { list_for_each_entry_safe(node, safe, &bat_priv->tt_roam_list, list) {
if (!has_timed_out(node->first_time, ROAMING_MAX_TIME)) if (!batadv_has_timed_out(node->first_time, ROAMING_MAX_TIME))
continue; continue;
list_del(&node->list); list_del(&node->list);
...@@ -1901,10 +1900,11 @@ static bool tt_check_roam_count(struct bat_priv *bat_priv, ...@@ -1901,10 +1900,11 @@ static bool tt_check_roam_count(struct bat_priv *bat_priv,
* reply from the same orig_node yet * reply from the same orig_node yet
*/ */
list_for_each_entry(tt_roam_node, &bat_priv->tt_roam_list, list) { list_for_each_entry(tt_roam_node, &bat_priv->tt_roam_list, list) {
if (!compare_eth(tt_roam_node->addr, client)) if (!batadv_compare_eth(tt_roam_node->addr, client))
continue; continue;
if (has_timed_out(tt_roam_node->first_time, ROAMING_MAX_TIME)) if (batadv_has_timed_out(tt_roam_node->first_time,
ROAMING_MAX_TIME))
continue; continue;
if (!atomic_dec_not_zero(&tt_roam_node->counter)) if (!atomic_dec_not_zero(&tt_roam_node->counter))
...@@ -1971,7 +1971,7 @@ static void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client, ...@@ -1971,7 +1971,7 @@ static void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
if (!neigh_node) if (!neigh_node)
goto out; goto out;
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Sending ROAMING_ADV to %pM (client %pM) via %pM\n", "Sending ROAMING_ADV to %pM (client %pM) via %pM\n",
orig_node->orig, client, neigh_node->addr); orig_node->orig, client, neigh_node->addr);
...@@ -2078,7 +2078,7 @@ static void tt_local_purge_pending_clients(struct bat_priv *bat_priv) ...@@ -2078,7 +2078,7 @@ static void tt_local_purge_pending_clients(struct bat_priv *bat_priv)
if (!(tt_common_entry->flags & TT_CLIENT_PENDING)) if (!(tt_common_entry->flags & TT_CLIENT_PENDING))
continue; continue;
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"Deleting local tt entry (%pM): pending\n", "Deleting local tt entry (%pM): pending\n",
tt_common_entry->addr); tt_common_entry->addr);
...@@ -2113,7 +2113,8 @@ static int tt_commit_changes(struct bat_priv *bat_priv, ...@@ -2113,7 +2113,8 @@ static int tt_commit_changes(struct bat_priv *bat_priv,
/* Increment the TTVN only once per OGM interval */ /* Increment the TTVN only once per OGM interval */
atomic_inc(&bat_priv->ttvn); atomic_inc(&bat_priv->ttvn);
bat_dbg(DBG_TT, bat_priv, "Local changes committed, updating to ttvn %u\n", batadv_dbg(DBG_TT, bat_priv,
"Local changes committed, updating to ttvn %u\n",
(uint8_t)atomic_read(&bat_priv->ttvn)); (uint8_t)atomic_read(&bat_priv->ttvn));
bat_priv->tt_poss_change = false; bat_priv->tt_poss_change = false;
...@@ -2235,7 +2236,7 @@ void batadv_tt_update_orig(struct bat_priv *bat_priv, ...@@ -2235,7 +2236,7 @@ void batadv_tt_update_orig(struct bat_priv *bat_priv,
if (!orig_node->tt_initialised || ttvn != orig_ttvn || if (!orig_node->tt_initialised || ttvn != orig_ttvn ||
orig_node->tt_crc != tt_crc) { orig_node->tt_crc != tt_crc) {
request_table: request_table:
bat_dbg(DBG_TT, bat_priv, batadv_dbg(DBG_TT, bat_priv,
"TT inconsistency for %pM. Need to retrieve the correct information (ttvn: %u last_ttvn: %u crc: %u last_crc: %u num_changes: %u)\n", "TT inconsistency for %pM. Need to retrieve the correct information (ttvn: %u last_ttvn: %u crc: %u last_crc: %u num_changes: %u)\n",
orig_node->orig, ttvn, orig_ttvn, tt_crc, orig_node->orig, ttvn, orig_ttvn, tt_crc,
orig_node->tt_crc, tt_num_changes); orig_node->tt_crc, tt_num_changes);
......
...@@ -59,7 +59,7 @@ static int vis_info_cmp(const struct hlist_node *node, const void *data2) ...@@ -59,7 +59,7 @@ static int vis_info_cmp(const struct hlist_node *node, const void *data2)
d2 = data2; d2 = data2;
p1 = (struct vis_packet *)d1->skb_packet->data; p1 = (struct vis_packet *)d1->skb_packet->data;
p2 = (struct vis_packet *)d2->skb_packet->data; p2 = (struct vis_packet *)d2->skb_packet->data;
return compare_eth(p1->vis_orig, p2->vis_orig); return batadv_compare_eth(p1->vis_orig, p2->vis_orig);
} }
/* hash function to choose an entry in a hash table of given size /* hash function to choose an entry in a hash table of given size
...@@ -127,7 +127,7 @@ static void vis_data_insert_interface(const uint8_t *interface, ...@@ -127,7 +127,7 @@ static void vis_data_insert_interface(const uint8_t *interface,
struct hlist_node *pos; struct hlist_node *pos;
hlist_for_each_entry(entry, pos, if_list, list) { hlist_for_each_entry(entry, pos, if_list, list) {
if (compare_eth(entry->addr, interface)) if (batadv_compare_eth(entry->addr, interface))
return; return;
} }
...@@ -181,7 +181,7 @@ static ssize_t vis_data_read_entry(char *buff, ...@@ -181,7 +181,7 @@ static ssize_t vis_data_read_entry(char *buff,
/* maximal length: max(4+17+2, 3+17+1+3+2) == 26 */ /* maximal length: max(4+17+2, 3+17+1+3+2) == 26 */
if (primary && entry->quality == 0) if (primary && entry->quality == 0)
return sprintf(buff, "TT %pM, ", entry->dest); return sprintf(buff, "TT %pM, ", entry->dest);
else if (compare_eth(entry->src, src)) else if (batadv_compare_eth(entry->src, src))
return sprintf(buff, "TQ %pM %d, ", entry->dest, return sprintf(buff, "TQ %pM %d, ", entry->dest,
entry->quality); entry->quality);
...@@ -233,7 +233,7 @@ int batadv_vis_seq_print_text(struct seq_file *seq, void *offset) ...@@ -233,7 +233,7 @@ int batadv_vis_seq_print_text(struct seq_file *seq, void *offset)
for (j = 0; j < packet->entries; j++) { for (j = 0; j < packet->entries; j++) {
if (entries[j].quality == 0) if (entries[j].quality == 0)
continue; continue;
if (compare_eth(entries[j].src, if (batadv_compare_eth(entries[j].src,
packet->vis_orig)) packet->vis_orig))
continue; continue;
vis_data_insert_interface(entries[j].src, vis_data_insert_interface(entries[j].src,
...@@ -245,7 +245,8 @@ int batadv_vis_seq_print_text(struct seq_file *seq, void *offset) ...@@ -245,7 +245,8 @@ int batadv_vis_seq_print_text(struct seq_file *seq, void *offset)
buf_size += 18 + 26 * packet->entries; buf_size += 18 + 26 * packet->entries;
/* add primary/secondary records */ /* add primary/secondary records */
if (compare_eth(entry->addr, packet->vis_orig)) if (batadv_compare_eth(entry->addr,
packet->vis_orig))
buf_size += buf_size +=
vis_data_count_prim_sec(&vis_if_list); vis_data_count_prim_sec(&vis_if_list);
...@@ -285,7 +286,7 @@ int batadv_vis_seq_print_text(struct seq_file *seq, void *offset) ...@@ -285,7 +286,7 @@ int batadv_vis_seq_print_text(struct seq_file *seq, void *offset)
for (j = 0; j < packet->entries; j++) { for (j = 0; j < packet->entries; j++) {
if (entries[j].quality == 0) if (entries[j].quality == 0)
continue; continue;
if (compare_eth(entries[j].src, if (batadv_compare_eth(entries[j].src,
packet->vis_orig)) packet->vis_orig))
continue; continue;
vis_data_insert_interface(entries[j].src, vis_data_insert_interface(entries[j].src,
...@@ -305,7 +306,8 @@ int batadv_vis_seq_print_text(struct seq_file *seq, void *offset) ...@@ -305,7 +306,8 @@ int batadv_vis_seq_print_text(struct seq_file *seq, void *offset)
entry->primary); entry->primary);
/* add primary/secondary records */ /* add primary/secondary records */
if (compare_eth(entry->addr, packet->vis_orig)) if (batadv_compare_eth(entry->addr,
packet->vis_orig))
buff_pos += buff_pos +=
vis_data_read_prim_sec(buff + buff_pos, vis_data_read_prim_sec(buff + buff_pos,
&vis_if_list); &vis_if_list);
...@@ -379,7 +381,7 @@ static int recv_list_is_in(struct bat_priv *bat_priv, ...@@ -379,7 +381,7 @@ static int recv_list_is_in(struct bat_priv *bat_priv,
spin_lock_bh(&bat_priv->vis_list_lock); spin_lock_bh(&bat_priv->vis_list_lock);
list_for_each_entry(entry, recv_list, list) { list_for_each_entry(entry, recv_list, list) {
if (compare_eth(entry->mac, mac)) { if (batadv_compare_eth(entry->mac, mac)) {
spin_unlock_bh(&bat_priv->vis_list_lock); spin_unlock_bh(&bat_priv->vis_list_lock);
return 1; return 1;
} }
...@@ -651,7 +653,7 @@ static int generate_vis_packet(struct bat_priv *bat_priv) ...@@ -651,7 +653,7 @@ static int generate_vis_packet(struct bat_priv *bat_priv)
if (!router) if (!router)
continue; continue;
if (!compare_eth(router->addr, orig_node->orig)) if (!batadv_compare_eth(router->addr, orig_node->orig))
goto next; goto next;
if (router->if_incoming->if_status != IF_ACTIVE) if (router->if_incoming->if_status != IF_ACTIVE)
...@@ -728,7 +730,8 @@ static void purge_vis_packets(struct bat_priv *bat_priv) ...@@ -728,7 +730,8 @@ static void purge_vis_packets(struct bat_priv *bat_priv)
if (info == bat_priv->my_vis_info) if (info == bat_priv->my_vis_info)
continue; continue;
if (has_timed_out(info->first_seen, VIS_TIMEOUT)) { if (batadv_has_timed_out(info->first_seen,
VIS_TIMEOUT)) {
hlist_del(node); hlist_del(node);
send_list_del(info); send_list_del(info);
kref_put(&info->refcount, free_info); kref_put(&info->refcount, free_info);
......
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