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

Commit 3193e8fd authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Antonio Quartulli
Browse files

batman-adv: Prefix main 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 d0f714f4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -94,13 +94,13 @@ static int log_open(struct inode *inode, struct file *file)
{
	nonseekable_open(inode, file);
	file->private_data = inode->i_private;
	inc_module_count();
	batadv_inc_module_count();
	return 0;
}

static int log_release(struct inode *inode, struct file *file)
{
	dec_module_count();
	batadv_dec_module_count();
	return 0;
}

@@ -224,7 +224,7 @@ static void debug_log_cleanup(struct bat_priv *bat_priv)

static int bat_algorithms_open(struct inode *inode, struct file *file)
{
	return single_open(file, bat_algo_seq_print_text, NULL);
	return single_open(file, batadv_algo_seq_print_text, NULL);
}

static int originators_open(struct inode *inode, struct file *file)
+8 −8
Original line number Diff line number Diff line
@@ -204,7 +204,7 @@ static void bat_iv_ogm_send_to_if(struct forw_packet *forw_packet,
		batadv_inc_counter(bat_priv, BAT_CNT_MGMT_TX);
		batadv_add_counter(bat_priv, BAT_CNT_MGMT_TX_BYTES,
				   skb->len + ETH_HLEN);
		batadv_send_skb_packet(skb, hard_iface, broadcast_addr);
		batadv_send_skb_packet(skb, hard_iface, batadv_broadcast_addr);
	}
}

@@ -255,7 +255,7 @@ static void bat_iv_ogm_emit(struct forw_packet *forw_packet)
		/* skb is only used once and than forw_packet is free'd */
		batadv_send_skb_packet(forw_packet->skb,
				       forw_packet->if_incoming,
				       broadcast_addr);
				       batadv_broadcast_addr);
		forw_packet->skb = NULL;

		goto out;
@@ -263,7 +263,7 @@ static void bat_iv_ogm_emit(struct forw_packet *forw_packet)

	/* broadcast on every interface */
	rcu_read_lock();
	list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
	list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
		if (hard_iface->soft_iface != soft_iface)
			continue;

@@ -425,7 +425,7 @@ static void bat_iv_ogm_aggregate_new(const unsigned char *packet_buff,
	/* start timer for this packet */
	INIT_DELAYED_WORK(&forw_packet_aggr->delayed_work,
			  batadv_send_outstanding_bat_ogm_packet);
	queue_delayed_work(bat_event_workqueue,
	queue_delayed_work(batadv_event_workqueue,
			   &forw_packet_aggr->delayed_work,
			   send_time - jiffies);

@@ -984,7 +984,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
		batman_ogm_packet->header.version, has_directlink_flag);

	rcu_read_lock();
	list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
	list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
		if (hard_iface->if_status != IF_ACTIVE)
			continue;

@@ -1259,18 +1259,18 @@ int __init batadv_iv_init(void)
	int ret;

	/* batman originator packet */
	ret = recv_handler_register(BAT_IV_OGM, bat_iv_ogm_receive);
	ret = batadv_recv_handler_register(BAT_IV_OGM, bat_iv_ogm_receive);
	if (ret < 0)
		goto out;

	ret = bat_algo_register(&batman_iv);
	ret = batadv_algo_register(&batman_iv);
	if (ret < 0)
		goto handler_unregister;

	goto out;

handler_unregister:
	recv_handler_unregister(BAT_IV_OGM);
	batadv_recv_handler_unregister(BAT_IV_OGM);
out:
	return ret;
}
+1 −1
Original line number Diff line number Diff line
@@ -1070,7 +1070,7 @@ void batadv_bla_update_orig_address(struct bat_priv *bat_priv,
static void bla_start_timer(struct bat_priv *bat_priv)
{
	INIT_DELAYED_WORK(&bat_priv->bla_work, bla_periodic_work);
	queue_delayed_work(bat_event_workqueue, &bat_priv->bla_work,
	queue_delayed_work(batadv_event_workqueue, &bat_priv->bla_work,
			   msecs_to_jiffies(BLA_PERIOD_LENGTH));
}

+7 −7
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ struct hard_iface *batadv_hardif_get_by_netdev(const struct net_device *net_dev)
	struct hard_iface *hard_iface;

	rcu_read_lock();
	list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
	list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
		if (hard_iface->net_dev == net_dev &&
		    atomic_inc_not_zero(&hard_iface->refcount))
			goto out;
@@ -86,7 +86,7 @@ static struct hard_iface *hardif_get_active(const struct net_device *soft_iface)
	struct hard_iface *hard_iface;

	rcu_read_lock();
	list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
	list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
		if (hard_iface->soft_iface != soft_iface)
			continue;

@@ -161,7 +161,7 @@ static void check_known_mac_addr(const struct net_device *net_dev)
	const struct hard_iface *hard_iface;

	rcu_read_lock();
	list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
	list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
		if ((hard_iface->if_status != IF_ACTIVE) &&
		    (hard_iface->if_status != IF_TO_BE_ACTIVATED))
			continue;
@@ -192,7 +192,7 @@ int batadv_hardif_min_mtu(struct net_device *soft_iface)
		goto out;

	rcu_read_lock();
	list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
	list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
		if ((hard_iface->if_status != IF_ACTIVE) &&
		    (hard_iface->if_status != IF_TO_BE_ACTIVATED))
			continue;
@@ -315,7 +315,7 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
	batadv_orig_hash_add_if(hard_iface, bat_priv->num_ifaces);

	hard_iface->batman_adv_ptype.type = __constant_htons(ETH_P_BATMAN);
	hard_iface->batman_adv_ptype.func = batman_skb_recv;
	hard_iface->batman_adv_ptype.func = batadv_batman_skb_recv;
	hard_iface->batman_adv_ptype.dev = hard_iface->net_dev;
	dev_add_pack(&hard_iface->batman_adv_ptype);

@@ -436,7 +436,7 @@ static struct hard_iface *hardif_add_interface(struct net_device *net_dev)
	atomic_set(&hard_iface->refcount, 2);

	check_known_mac_addr(hard_iface->net_dev);
	list_add_tail_rcu(&hard_iface->list, &hardif_list);
	list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list);

	/**
	 * This can't be called via a bat_priv callback because
@@ -477,7 +477,7 @@ void batadv_hardif_remove_interfaces(void)

	rtnl_lock();
	list_for_each_entry_safe(hard_iface, hard_iface_tmp,
				 &hardif_list, list) {
				 &batadv_hardif_list, list) {
		list_del_rcu(&hard_iface->list);
		hardif_remove_interface(hard_iface);
	}
+2 −2
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ static int bat_socket_open(struct inode *inode, struct file *file)

	file->private_data = socket_client;

	inc_module_count();
	batadv_inc_module_count();
	return 0;
}

@@ -98,7 +98,7 @@ static int bat_socket_release(struct inode *inode, struct file *file)
	spin_unlock_bh(&socket_client->lock);

	kfree(socket_client);
	dec_module_count();
	batadv_dec_module_count();

	return 0;
}
Loading