Commit 9455e34c authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Antonio Quartulli
Browse files

batman-adv: Prefix send 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 30d3c511
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -201,7 +201,7 @@ static void bat_iv_ogm_send_to_if(struct forw_packet *forw_packet,
		batadv_inc_counter(bat_priv, BAT_CNT_MGMT_TX);
		batadv_inc_counter(bat_priv, BAT_CNT_MGMT_TX);
		batadv_add_counter(bat_priv, BAT_CNT_MGMT_TX_BYTES,
		batadv_add_counter(bat_priv, BAT_CNT_MGMT_TX_BYTES,
				   skb->len + ETH_HLEN);
				   skb->len + ETH_HLEN);
		send_skb_packet(skb, hard_iface, broadcast_addr);
		batadv_send_skb_packet(skb, hard_iface, broadcast_addr);
	}
	}
}
}


@@ -250,7 +250,8 @@ static void bat_iv_ogm_emit(struct forw_packet *forw_packet)
			forw_packet->if_incoming->net_dev->dev_addr);
			forw_packet->if_incoming->net_dev->dev_addr);


		/* skb is only used once and than forw_packet is free'd */
		/* skb is only used once and than forw_packet is free'd */
		send_skb_packet(forw_packet->skb, forw_packet->if_incoming,
		batadv_send_skb_packet(forw_packet->skb,
				       forw_packet->if_incoming,
				       broadcast_addr);
				       broadcast_addr);
		forw_packet->skb = NULL;
		forw_packet->skb = NULL;


@@ -420,7 +421,7 @@ static void bat_iv_ogm_aggregate_new(const unsigned char *packet_buff,


	/* start timer for this packet */
	/* start timer for this packet */
	INIT_DELAYED_WORK(&forw_packet_aggr->delayed_work,
	INIT_DELAYED_WORK(&forw_packet_aggr->delayed_work,
			  send_outstanding_bat_ogm_packet);
			  batadv_send_outstanding_bat_ogm_packet);
	queue_delayed_work(bat_event_workqueue,
	queue_delayed_work(bat_event_workqueue,
			   &forw_packet_aggr->delayed_work,
			   &forw_packet_aggr->delayed_work,
			   send_time - jiffies);
			   send_time - jiffies);
+2 −2
Original line number Original line Diff line number Diff line
@@ -345,7 +345,7 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
			hard_iface->net_dev->name);
			hard_iface->net_dev->name);


	/* begin scheduling originator messages on that interface */
	/* begin scheduling originator messages on that interface */
	schedule_bat_ogm(hard_iface);
	batadv_schedule_bat_ogm(hard_iface);


out:
out:
	return 0;
	return 0;
@@ -391,7 +391,7 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)


	/* delete all references to this hard_iface */
	/* delete all references to this hard_iface */
	batadv_purge_orig_ref(bat_priv);
	batadv_purge_orig_ref(bat_priv);
	purge_outstanding_packets(bat_priv, hard_iface);
	batadv_purge_outstanding_packets(bat_priv, hard_iface);
	dev_put(hard_iface->soft_iface);
	dev_put(hard_iface->soft_iface);


	/* nobody uses this interface anymore */
	/* nobody uses this interface anymore */
+1 −1
Original line number Original line Diff line number Diff line
@@ -236,7 +236,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
		memcpy(icmp_packet->rr,
		memcpy(icmp_packet->rr,
		       neigh_node->if_incoming->net_dev->dev_addr, ETH_ALEN);
		       neigh_node->if_incoming->net_dev->dev_addr, ETH_ALEN);


	send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
	batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
	goto out;
	goto out;


dst_unreach:
dst_unreach:
+1 −1
Original line number Original line Diff line number Diff line
@@ -145,7 +145,7 @@ void mesh_free(struct net_device *soft_iface)


	atomic_set(&bat_priv->mesh_state, MESH_DEACTIVATING);
	atomic_set(&bat_priv->mesh_state, MESH_DEACTIVATING);


	purge_outstanding_packets(bat_priv, NULL);
	batadv_purge_outstanding_packets(bat_priv, NULL);


	vis_quit(bat_priv);
	vis_quit(bat_priv);


+5 −5
Original line number Original line Diff line number Diff line
@@ -319,7 +319,7 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
	icmp_packet->msg_type = ECHO_REPLY;
	icmp_packet->msg_type = ECHO_REPLY;
	icmp_packet->header.ttl = TTL;
	icmp_packet->header.ttl = TTL;


	send_skb_packet(skb, router->if_incoming, router->addr);
	batadv_send_skb_packet(skb, router->if_incoming, router->addr);
	ret = NET_RX_SUCCESS;
	ret = NET_RX_SUCCESS;


out:
out:
@@ -374,7 +374,7 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
	icmp_packet->msg_type = TTL_EXCEEDED;
	icmp_packet->msg_type = TTL_EXCEEDED;
	icmp_packet->header.ttl = TTL;
	icmp_packet->header.ttl = TTL;


	send_skb_packet(skb, router->if_incoming, router->addr);
	batadv_send_skb_packet(skb, router->if_incoming, router->addr);
	ret = NET_RX_SUCCESS;
	ret = NET_RX_SUCCESS;


out:
out:
@@ -459,7 +459,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
	icmp_packet->header.ttl--;
	icmp_packet->header.ttl--;


	/* route it */
	/* route it */
	send_skb_packet(skb, router->if_incoming, router->addr);
	batadv_send_skb_packet(skb, router->if_incoming, router->addr);
	ret = NET_RX_SUCCESS;
	ret = NET_RX_SUCCESS;


out:
out:
@@ -881,7 +881,7 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
			   skb->len + ETH_HLEN);
			   skb->len + ETH_HLEN);


	/* route it */
	/* route it */
	send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
	batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
	ret = NET_RX_SUCCESS;
	ret = NET_RX_SUCCESS;


out:
out:
@@ -1095,7 +1095,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
		goto out;
		goto out;


	/* rebroadcast packet */
	/* rebroadcast packet */
	add_bcast_packet_to_list(bat_priv, skb, 1);
	batadv_add_bcast_packet_to_list(bat_priv, skb, 1);


	/* don't hand the broadcast up if it is from an originator
	/* don't hand the broadcast up if it is from an originator
	 * from the same backbone.
	 * from the same backbone.
Loading