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

Commit f097e25d authored by Martin Hundebøll's avatar Martin Hundebøll Committed by Antonio Quartulli
Browse files

batman-adv: Remove old fragmentation code



Remove the existing fragmentation code before adding the new version
and delete unicast.{h,c}.

batadv_unicast_send_skb() is moved to send.c and renamed to
batadv_send_skb_unicast().

fragmentation entry in sysfs (bat_priv->fragmentation) is kept for use in
the new fragmentation code.

BATADV_UNICAST_FRAG packet type is renamed to BATADV_FRAG for use in the
new fragmentation code.

Signed-off-by: default avatarMartin Hundebøll <martin@hundeboll.net>
Signed-off-by: default avatarMarek Lindner <lindner_marek@yahoo.de>
Signed-off-by: default avatarAntonio Quartulli <antonio@meshcoding.com>
parent 2c598663
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -37,4 +37,3 @@ batman-adv-y += send.o
batman-adv-y += soft-interface.o
batman-adv-y += sysfs.o
batman-adv-y += translation-table.o
batman-adv-y += unicast.o
+5 −6
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@
#include "send.h"
#include "types.h"
#include "translation-table.h"
#include "unicast.h"

static void batadv_dat_purge(struct work_struct *work);

@@ -592,7 +591,7 @@ static bool batadv_dat_send_data(struct batadv_priv *bat_priv,
			goto free_orig;

		tmp_skb = pskb_copy(skb, GFP_ATOMIC);
		if (!batadv_unicast_4addr_prepare_skb(bat_priv, tmp_skb,
		if (!batadv_send_skb_prepare_unicast_4addr(bat_priv, tmp_skb,
							   cand[i].orig_node,
							   packet_subtype)) {
			kfree_skb(tmp_skb);
@@ -990,10 +989,10 @@ bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv,
	 * that a node not using the 4addr packet format doesn't support it.
	 */
	if (hdr_size == sizeof(struct batadv_unicast_4addr_packet))
		err = batadv_unicast_4addr_send_skb(bat_priv, skb_new,
		err = batadv_send_skb_unicast_4addr(bat_priv, skb_new,
						    BATADV_P_DAT_CACHE_REPLY);
	else
		err = batadv_unicast_send_skb(bat_priv, skb_new);
		err = batadv_send_skb_unicast(bat_priv, skb_new);

	if (!err) {
		batadv_inc_counter(bat_priv, BATADV_CNT_DAT_CACHED_REPLY_TX);
+0 −1
Original line number Diff line number Diff line
@@ -444,7 +444,6 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
	hard_iface->batman_adv_ptype.dev = hard_iface->net_dev;
	dev_add_pack(&hard_iface->batman_adv_ptype);

	atomic_set(&hard_iface->frag_seqno, 1);
	batadv_info(hard_iface->soft_iface, "Adding interface: %s\n",
		    hard_iface->net_dev->name);

+0 −4
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@
#include "gateway_client.h"
#include "bridge_loop_avoidance.h"
#include "distributed-arp-table.h"
#include "unicast.h"
#include "gateway_common.h"
#include "hash.h"
#include "bat_algo.h"
@@ -399,7 +398,6 @@ static void batadv_recv_handler_init(void)
	/* compile time checks for struct member offsets */
	BUILD_BUG_ON(offsetof(struct batadv_unicast_4addr_packet, src) != 10);
	BUILD_BUG_ON(offsetof(struct batadv_unicast_packet, dest) != 4);
	BUILD_BUG_ON(offsetof(struct batadv_unicast_frag_packet, dest) != 4);
	BUILD_BUG_ON(offsetof(struct batadv_unicast_tvlv_packet, dst) != 4);
	BUILD_BUG_ON(offsetof(struct batadv_icmp_packet, dst) != 4);
	BUILD_BUG_ON(offsetof(struct batadv_icmp_packet_rr, dst) != 4);
@@ -412,8 +410,6 @@ static void batadv_recv_handler_init(void)
	batadv_rx_handler[BATADV_UNICAST_4ADDR] = batadv_recv_unicast_packet;
	/* unicast packet */
	batadv_rx_handler[BATADV_UNICAST] = batadv_recv_unicast_packet;
	/* fragmented unicast packet */
	batadv_rx_handler[BATADV_UNICAST_FRAG] = batadv_recv_ucast_frag_packet;
	/* unicast tvlv packet */
	batadv_rx_handler[BATADV_UNICAST_TVLV] = batadv_recv_unicast_tvlv;
	/* batman icmp packet */
+0 −9
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@
#include "routing.h"
#include "gateway_client.h"
#include "hard-interface.h"
#include "unicast.h"
#include "soft-interface.h"
#include "bridge_loop_avoidance.h"
#include "network-coding.h"
@@ -146,7 +145,6 @@ static void batadv_orig_node_free_rcu(struct rcu_head *rcu)
	/* Free nc_nodes */
	batadv_nc_purge_orig(orig_node->bat_priv, orig_node, NULL);

	batadv_frag_list_free(&orig_node->frag_list);
	batadv_tt_global_del_orig(orig_node->bat_priv, orig_node,
				  "originator timed out");

@@ -269,9 +267,6 @@ struct batadv_orig_node *batadv_get_orig_node(struct batadv_priv *bat_priv,
	size = bat_priv->num_ifaces * sizeof(uint8_t);
	orig_node->bcast_own_sum = kzalloc(size, GFP_ATOMIC);

	INIT_LIST_HEAD(&orig_node->frag_list);
	orig_node->last_frag_packet = 0;

	if (!orig_node->bcast_own_sum)
		goto free_bcast_own;

@@ -393,10 +388,6 @@ static void _batadv_purge_orig(struct batadv_priv *bat_priv)
				batadv_orig_node_free_ref(orig_node);
				continue;
			}

			if (batadv_has_timed_out(orig_node->last_frag_packet,
						 BATADV_FRAG_TIMEOUT))
				batadv_frag_list_free(&orig_node->frag_list);
		}
		spin_unlock_bh(list_lock);
	}
Loading