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

Commit 63b01037 authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Antonio Quartulli
Browse files

batman-adv: Prefix routing local static 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 03fc7f86
Loading
Loading
Loading
Loading
+34 −31
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@
#include "unicast.h"
#include "unicast.h"
#include "bridge_loop_avoidance.h"
#include "bridge_loop_avoidance.h"


static int route_unicast_packet(struct sk_buff *skb,
static int batadv_route_unicast_packet(struct sk_buff *skb,
				       struct hard_iface *recv_if);
				       struct hard_iface *recv_if);


void batadv_slide_own_bcast_window(struct hard_iface *hard_iface)
void batadv_slide_own_bcast_window(struct hard_iface *hard_iface)
@@ -61,7 +61,7 @@ void batadv_slide_own_bcast_window(struct hard_iface *hard_iface)
	}
	}
}
}


static void _update_route(struct bat_priv *bat_priv,
static void _batadv_update_route(struct bat_priv *bat_priv,
				 struct orig_node *orig_node,
				 struct orig_node *orig_node,
				 struct neigh_node *neigh_node)
				 struct neigh_node *neigh_node)
{
{
@@ -117,7 +117,7 @@ void batadv_update_route(struct bat_priv *bat_priv, struct orig_node *orig_node,
	router = batadv_orig_node_get_router(orig_node);
	router = batadv_orig_node_get_router(orig_node);


	if (router != neigh_node)
	if (router != neigh_node)
		_update_route(bat_priv, orig_node, neigh_node);
		_batadv_update_route(bat_priv, orig_node, neigh_node);


out:
out:
	if (router)
	if (router)
@@ -276,7 +276,7 @@ bool batadv_check_management_packet(struct sk_buff *skb,
	return true;
	return true;
}
}


static int recv_my_icmp_packet(struct bat_priv *bat_priv,
static int batadv_recv_my_icmp_packet(struct bat_priv *bat_priv,
				      struct sk_buff *skb, size_t icmp_len)
				      struct sk_buff *skb, size_t icmp_len)
{
{
	struct hard_iface *primary_if = NULL;
	struct hard_iface *primary_if = NULL;
@@ -331,7 +331,7 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
	return ret;
	return ret;
}
}


static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
static int batadv_recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
					 struct sk_buff *skb)
					 struct sk_buff *skb)
{
{
	struct hard_iface *primary_if = NULL;
	struct hard_iface *primary_if = NULL;
@@ -431,11 +431,11 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)


	/* packet for me */
	/* packet for me */
	if (batadv_is_my_mac(icmp_packet->dst))
	if (batadv_is_my_mac(icmp_packet->dst))
		return recv_my_icmp_packet(bat_priv, skb, hdr_size);
		return batadv_recv_my_icmp_packet(bat_priv, skb, hdr_size);


	/* TTL exceeded */
	/* TTL exceeded */
	if (icmp_packet->header.ttl < 2)
	if (icmp_packet->header.ttl < 2)
		return recv_icmp_ttl_exceeded(bat_priv, skb);
		return batadv_recv_icmp_ttl_exceeded(bat_priv, skb);


	/* get routing information */
	/* get routing information */
	orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->dst);
	orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->dst);
@@ -473,7 +473,8 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
 * This method rotates the bonding list and increases the
 * This method rotates the bonding list and increases the
 * returned router's refcount.
 * returned router's refcount.
 */
 */
static struct neigh_node *find_bond_router(struct orig_node *primary_orig,
static struct neigh_node *
batadv_find_bond_router(struct orig_node *primary_orig,
			const struct hard_iface *recv_if)
			const struct hard_iface *recv_if)
{
{
	struct neigh_node *tmp_neigh_node;
	struct neigh_node *tmp_neigh_node;
@@ -527,7 +528,8 @@ static struct neigh_node *find_bond_router(struct orig_node *primary_orig,
 *
 *
 * Increases the returned router's refcount
 * Increases the returned router's refcount
 */
 */
static struct neigh_node *find_ifalter_router(struct orig_node *primary_orig,
static struct neigh_node *
batadv_find_ifalter_router(struct orig_node *primary_orig,
			   const struct hard_iface *recv_if)
			   const struct hard_iface *recv_if)
{
{
	struct neigh_node *tmp_neigh_node;
	struct neigh_node *tmp_neigh_node;
@@ -614,7 +616,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
				   "Routing TT_REQUEST to %pM [%c]\n",
				   "Routing TT_REQUEST to %pM [%c]\n",
				   tt_query->dst,
				   tt_query->dst,
				   tt_flag);
				   tt_flag);
			return route_unicast_packet(skb, recv_if);
			return batadv_route_unicast_packet(skb, recv_if);
		}
		}
		break;
		break;
	case TT_RESPONSE:
	case TT_RESPONSE:
@@ -643,7 +645,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
				   "Routing TT_RESPONSE to %pM [%c]\n",
				   "Routing TT_RESPONSE to %pM [%c]\n",
				   tt_query->dst,
				   tt_query->dst,
				   tt_flag);
				   tt_flag);
			return route_unicast_packet(skb, recv_if);
			return batadv_route_unicast_packet(skb, recv_if);
		}
		}
		break;
		break;
	}
	}
@@ -679,7 +681,7 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
	roam_adv_packet = (struct roam_adv_packet *)skb->data;
	roam_adv_packet = (struct roam_adv_packet *)skb->data;


	if (!batadv_is_my_mac(roam_adv_packet->dst))
	if (!batadv_is_my_mac(roam_adv_packet->dst))
		return route_unicast_packet(skb, recv_if);
		return batadv_route_unicast_packet(skb, recv_if);


	/* check if it is a backbone gateway. we don't accept
	/* check if it is a backbone gateway. we don't accept
	 * roaming advertisement from it, as it has the same
	 * roaming advertisement from it, as it has the same
@@ -783,9 +785,9 @@ struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
	batadv_neigh_node_free_ref(router);
	batadv_neigh_node_free_ref(router);


	if (bonding_enabled)
	if (bonding_enabled)
		router = find_bond_router(primary_orig_node, recv_if);
		router = batadv_find_bond_router(primary_orig_node, recv_if);
	else
	else
		router = find_ifalter_router(primary_orig_node, recv_if);
		router = batadv_find_ifalter_router(primary_orig_node, recv_if);


return_router:
return_router:
	if (router && router->if_incoming->if_status != IF_ACTIVE)
	if (router && router->if_incoming->if_status != IF_ACTIVE)
@@ -801,7 +803,7 @@ struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
	return NULL;
	return NULL;
}
}


static int check_unicast_packet(struct sk_buff *skb, int hdr_size)
static int batadv_check_unicast_packet(struct sk_buff *skb, int hdr_size)
{
{
	struct ethhdr *ethhdr;
	struct ethhdr *ethhdr;


@@ -826,7 +828,8 @@ static int check_unicast_packet(struct sk_buff *skb, int hdr_size)
	return 0;
	return 0;
}
}


static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
static int batadv_route_unicast_packet(struct sk_buff *skb,
				       struct hard_iface *recv_if)
{
{
	struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
	struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
	struct orig_node *orig_node = NULL;
	struct orig_node *orig_node = NULL;
@@ -911,7 +914,7 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
	return ret;
	return ret;
}
}


static int check_unicast_ttvn(struct bat_priv *bat_priv,
static int batadv_check_unicast_ttvn(struct bat_priv *bat_priv,
				     struct sk_buff *skb) {
				     struct sk_buff *skb) {
	uint8_t curr_ttvn;
	uint8_t curr_ttvn;
	struct orig_node *orig_node;
	struct orig_node *orig_node;
@@ -994,10 +997,10 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
	struct unicast_packet *unicast_packet;
	struct unicast_packet *unicast_packet;
	int hdr_size = sizeof(*unicast_packet);
	int hdr_size = sizeof(*unicast_packet);


	if (check_unicast_packet(skb, hdr_size) < 0)
	if (batadv_check_unicast_packet(skb, hdr_size) < 0)
		return NET_RX_DROP;
		return NET_RX_DROP;


	if (!check_unicast_ttvn(bat_priv, skb))
	if (!batadv_check_unicast_ttvn(bat_priv, skb))
		return NET_RX_DROP;
		return NET_RX_DROP;


	unicast_packet = (struct unicast_packet *)skb->data;
	unicast_packet = (struct unicast_packet *)skb->data;
@@ -1009,7 +1012,7 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
		return NET_RX_SUCCESS;
		return NET_RX_SUCCESS;
	}
	}


	return route_unicast_packet(skb, recv_if);
	return batadv_route_unicast_packet(skb, recv_if);
}
}


int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
@@ -1021,10 +1024,10 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
	struct sk_buff *new_skb = NULL;
	struct sk_buff *new_skb = NULL;
	int ret;
	int ret;


	if (check_unicast_packet(skb, hdr_size) < 0)
	if (batadv_check_unicast_packet(skb, hdr_size) < 0)
		return NET_RX_DROP;
		return NET_RX_DROP;


	if (!check_unicast_ttvn(bat_priv, skb))
	if (!batadv_check_unicast_ttvn(bat_priv, skb))
		return NET_RX_DROP;
		return NET_RX_DROP;


	unicast_packet = (struct unicast_frag_packet *)skb->data;
	unicast_packet = (struct unicast_frag_packet *)skb->data;
@@ -1046,7 +1049,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
		return NET_RX_SUCCESS;
		return NET_RX_SUCCESS;
	}
	}


	return route_unicast_packet(skb, recv_if);
	return batadv_route_unicast_packet(skb, recv_if);
}
}