Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08c36d3e authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Antonio Quartulli
Browse files

batman-adv: Prefix translation-table 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: default avatarDavid Miller <davem@davemloft.net>
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
parent 04b482a2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ static int gateways_open(struct inode *inode, struct file *file)
static int transtable_global_open(struct inode *inode, struct file *file)
{
	struct net_device *net_dev = (struct net_device *)inode->i_private;
	return single_open(file, tt_global_seq_print_text, net_dev);
	return single_open(file, batadv_tt_global_seq_print_text, net_dev);
}

#ifdef CONFIG_BATMAN_ADV_BLA
@@ -257,7 +257,7 @@ static int bla_claim_table_open(struct inode *inode, struct file *file)
static int transtable_local_open(struct inode *inode, struct file *file)
{
	struct net_device *net_dev = (struct net_device *)inode->i_private;
	return single_open(file, tt_local_seq_print_text, net_dev);
	return single_open(file, batadv_tt_local_seq_print_text, net_dev);
}

static int vis_data_open(struct inode *inode, struct file *file)
+13 −10
Original line number Diff line number Diff line
@@ -138,7 +138,10 @@ static uint8_t hop_penalty(uint8_t tq, const struct bat_priv *bat_priv)
static int bat_iv_ogm_aggr_packet(int buff_pos, int packet_len,
				  int tt_num_changes)
{
	int next_buff_pos = buff_pos + BATMAN_OGM_HLEN + tt_len(tt_num_changes);
	int next_buff_pos = 0;

	next_buff_pos += buff_pos + BATMAN_OGM_HLEN;
	next_buff_pos += batadv_tt_len(tt_num_changes);

	return (next_buff_pos <= packet_len) &&
		(next_buff_pos <= MAX_AGGREGATION_BYTES);
@@ -188,8 +191,8 @@ static void bat_iv_ogm_send_to_if(struct forw_packet *forw_packet,
			batman_ogm_packet->ttvn, hard_iface->net_dev->name,
			hard_iface->net_dev->dev_addr);

		buff_pos += BATMAN_OGM_HLEN +
				tt_len(batman_ogm_packet->tt_num_changes);
		buff_pos += BATMAN_OGM_HLEN;
		buff_pos += batadv_tt_len(batman_ogm_packet->tt_num_changes);
		packet_num++;
		batman_ogm_packet = (struct batman_ogm_packet *)
					(forw_packet->skb->data + buff_pos);
@@ -556,7 +559,7 @@ static void bat_iv_ogm_forward(struct orig_node *orig_node,
		batman_ogm_packet->flags &= ~DIRECTLINK;

	bat_iv_ogm_queue_add(bat_priv, (unsigned char *)batman_ogm_packet,
			     BATMAN_OGM_HLEN + tt_len(tt_num_changes),
			     BATMAN_OGM_HLEN + batadv_tt_len(tt_num_changes),
			     if_incoming, 0, bat_iv_ogm_fwd_send_time());
}

@@ -724,7 +727,7 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
	if (((batman_ogm_packet->orig != ethhdr->h_source) &&
	     (batman_ogm_packet->header.ttl > 2)) ||
	    (batman_ogm_packet->flags & PRIMARIES_FIRST_HOP))
		tt_update_orig(bat_priv, orig_node, tt_buff,
		batadv_tt_update_orig(bat_priv, orig_node, tt_buff,
				      batman_ogm_packet->tt_num_changes,
				      batman_ogm_packet->ttvn,
				      ntohs(batman_ogm_packet->tt_crc));
@@ -1229,8 +1232,8 @@ static int bat_iv_ogm_receive(struct sk_buff *skb,
		bat_iv_ogm_process(ethhdr, batman_ogm_packet,
				   tt_buff, if_incoming);

		buff_pos += BATMAN_OGM_HLEN +
				tt_len(batman_ogm_packet->tt_num_changes);
		buff_pos += BATMAN_OGM_HLEN;
		buff_pos += batadv_tt_len(batman_ogm_packet->tt_num_changes);

		batman_ogm_packet = (struct batman_ogm_packet *)
						(packet_buff + buff_pos);
+2 −2
Original line number Diff line number Diff line
@@ -397,7 +397,7 @@ static struct backbone_gw *bla_get_backbone_gw(struct bat_priv *bat_priv,
	/* this is a gateway now, remove any tt entries */
	orig_node = orig_hash_find(bat_priv, orig);
	if (orig_node) {
		tt_global_del_orig(bat_priv, orig_node,
		batadv_tt_global_del_orig(bat_priv, orig_node,
					  "became a backbone gateway");
		batadv_orig_node_free_ref(orig_node);
	}
+2 −2
Original line number Diff line number Diff line
@@ -652,7 +652,7 @@ bool batadv_gw_out_of_range(struct bat_priv *bat_priv,
	if (!ret)
		goto out;

	orig_dst_node = transtable_search(bat_priv, ethhdr->h_source,
	orig_dst_node = batadv_transtable_search(bat_priv, ethhdr->h_source,
						 ethhdr->h_dest);
	if (!orig_dst_node)
		goto out;
+3 −3
Original line number Diff line number Diff line
@@ -115,11 +115,11 @@ int mesh_init(struct net_device *soft_iface)
	if (ret < 0)
		goto err;

	ret = tt_init(bat_priv);
	ret = batadv_tt_init(bat_priv);
	if (ret < 0)
		goto err;

	tt_local_add(soft_iface, soft_iface->dev_addr, NULL_IFINDEX);
	batadv_tt_local_add(soft_iface, soft_iface->dev_addr, NULL_IFINDEX);

	ret = vis_init(bat_priv);
	if (ret < 0)
@@ -152,7 +152,7 @@ void mesh_free(struct net_device *soft_iface)
	batadv_gw_node_purge(bat_priv);
	batadv_originator_free(bat_priv);

	tt_free(bat_priv);
	batadv_tt_free(bat_priv);

	batadv_bla_free(bat_priv);

Loading