[commits] r1621 - trunk/batman-adv-kernelland

postmaster at open-mesh.net postmaster at open-mesh.net
Mon Apr 5 22:51:09 CEST 2010


Author: marek
Date: 2010-04-05 22:50:39 +0200 (Mon, 05 Apr 2010)
New Revision: 1621

Modified:
   trunk/batman-adv-kernelland/device.c
   trunk/batman-adv-kernelland/originator.c
   trunk/batman-adv-kernelland/routing.c
   trunk/batman-adv-kernelland/types.h
   trunk/batman-adv-kernelland/vis.c
Log:
batman-adv: remove redundant pointer to originator interface

Signed-off-by: Marek Lindner <lindner_marek at yahoo.de>

Modified: trunk/batman-adv-kernelland/device.c
===================================================================
--- trunk/batman-adv-kernelland/device.c	2010-04-05 20:50:36 UTC (rev 1620)
+++ trunk/batman-adv-kernelland/device.c	2010-04-05 20:50:39 UTC (rev 1621)
@@ -257,7 +257,7 @@
 	if (!orig_node->router)
 		goto unlock;
 
-	batman_if = orig_node->batman_if;
+	batman_if = orig_node->router->if_incoming;
 	memcpy(dstaddr, orig_node->router->addr, ETH_ALEN);
 
 	spin_unlock_irqrestore(&orig_hash_lock, flags);

Modified: trunk/batman-adv-kernelland/originator.c
===================================================================
--- trunk/batman-adv-kernelland/originator.c	2010-04-05 20:50:36 UTC (rev 1620)
+++ trunk/batman-adv-kernelland/originator.c	2010-04-05 20:50:39 UTC (rev 1621)
@@ -139,7 +139,6 @@
 
 	memcpy(orig_node->orig, addr, ETH_ALEN);
 	orig_node->router = NULL;
-	orig_node->batman_if = NULL;
 	orig_node->hna_buff = NULL;
 
 	size = num_ifs * sizeof(TYPE_OF_WORD) * NUM_WORDS;

Modified: trunk/batman-adv-kernelland/routing.c
===================================================================
--- trunk/batman-adv-kernelland/routing.c	2010-04-05 20:50:36 UTC (rev 1620)
+++ trunk/batman-adv-kernelland/routing.c	2010-04-05 20:50:39 UTC (rev 1621)
@@ -99,11 +99,6 @@
 		bat_dbg(DBG_ROUTES, "Changing route towards: %pM (now via %pM - was via %pM)\n", orig_node->orig, neigh_node->addr, orig_node->router->addr);
 	}
 
-	if (neigh_node != NULL)
-		orig_node->batman_if = neigh_node->if_incoming;
-	else
-		orig_node->batman_if = NULL;
-
 	orig_node->router = neigh_node;
 }
 
@@ -749,12 +744,11 @@
 	ret = NET_RX_DROP;
 
 	if ((orig_node != NULL) &&
-	    (orig_node->batman_if != NULL) &&
 	    (orig_node->router != NULL)) {
 
 		/* don't lock while sending the packets ... we therefore
 		 * copy the required data before sending */
-		batman_if = orig_node->batman_if;
+		batman_if = orig_node->router->if_incoming;
 		memcpy(dstaddr, orig_node->router->addr, ETH_ALEN);
 		spin_unlock_irqrestore(&orig_hash_lock, flags);
 
@@ -811,12 +805,11 @@
 	ret = NET_RX_DROP;
 
 	if ((orig_node != NULL) &&
-	    (orig_node->batman_if != NULL) &&
 	    (orig_node->router != NULL)) {
 
 		/* don't lock while sending the packets ... we therefore
 		 * copy the required data before sending */
-		batman_if = orig_node->batman_if;
+		batman_if = orig_node->router->if_incoming;
 		memcpy(dstaddr, orig_node->router->addr, ETH_ALEN);
 		spin_unlock_irqrestore(&orig_hash_lock, flags);
 
@@ -907,12 +900,11 @@
 		     hash_find(orig_hash, icmp_packet->dst));
 
 	if ((orig_node != NULL) &&
-	    (orig_node->batman_if != NULL) &&
 	    (orig_node->router != NULL)) {
 
 		/* don't lock while sending the packets ... we therefore
 		 * copy the required data before sending */
-		batman_if = orig_node->batman_if;
+		batman_if = orig_node->router->if_incoming;
 		memcpy(dstaddr, orig_node->router->addr, ETH_ALEN);
 		spin_unlock_irqrestore(&orig_hash_lock, flags);
 

Modified: trunk/batman-adv-kernelland/types.h
===================================================================
--- trunk/batman-adv-kernelland/types.h	2010-04-05 20:50:36 UTC (rev 1620)
+++ trunk/batman-adv-kernelland/types.h	2010-04-05 20:50:39 UTC (rev 1621)
@@ -49,7 +49,6 @@
 	uint8_t orig[ETH_ALEN];
 	uint8_t primary_addr[ETH_ALEN];	/* hosts primary interface address */
 	struct neigh_node *router;
-	struct batman_if *batman_if;
 	TYPE_OF_WORD *bcast_own;
 	uint8_t *bcast_own_sum;
 	uint8_t tq_own;

Modified: trunk/batman-adv-kernelland/vis.c
===================================================================
--- trunk/batman-adv-kernelland/vis.c	2010-04-05 20:50:36 UTC (rev 1620)
+++ trunk/batman-adv-kernelland/vis.c	2010-04-05 20:50:39 UTC (rev 1621)
@@ -499,14 +499,14 @@
 		if (orig_node->router != NULL
 			&& compare_orig(orig_node->router->addr,
 					orig_node->orig)
-			&& orig_node->batman_if
-			&& (orig_node->batman_if->if_active == IF_ACTIVE)
+			&& (orig_node->router->if_incoming->if_status ==
+								IF_ACTIVE)
 		    && orig_node->router->tq_avg > 0) {
 
 			/* fill one entry into buffer. */
 			entry = &entry_array[info->packet.entries];
 			memcpy(entry->src,
-			       orig_node->batman_if->net_dev->dev_addr,
+			     orig_node->router->if_incoming->net_dev->dev_addr,
 			       ETH_ALEN);
 			memcpy(entry->dest, orig_node->orig, ETH_ALEN);
 			entry->quality = orig_node->router->tq_avg;
@@ -574,8 +574,7 @@
 		orig_node = hashit.bucket->data;
 
 		/* if it's a vis server and reachable, send it. */
-		if ((!orig_node) || (!orig_node->batman_if) ||
-		    (!orig_node->router))
+		if ((!orig_node) || (!orig_node->router))
 			continue;
 		if (!(orig_node->flags & VIS_SERVER))
 			continue;
@@ -585,7 +584,7 @@
 			continue;
 
 		memcpy(info->packet.target_orig, orig_node->orig, ETH_ALEN);
-		batman_if = orig_node->batman_if;
+		batman_if = orig_node->router->if_incoming;
 		memcpy(dstaddr, orig_node->router->addr, ETH_ALEN);
 		spin_unlock_irqrestore(&orig_hash_lock, flags);
 
@@ -610,12 +609,12 @@
 	orig_node = ((struct orig_node *)
 		     hash_find(orig_hash, info->packet.target_orig));
 
-	if ((!orig_node) || (!orig_node->batman_if) || (!orig_node->router))
+	if ((!orig_node) || (!orig_node->router))
 		goto out;
 
 	/* don't lock while sending the packets ... we therefore
 	 * copy the required data before sending */
-	batman_if = orig_node->batman_if;
+	batman_if = orig_node->router->if_incoming;
 	memcpy(dstaddr, orig_node->router->addr, ETH_ALEN);
 	spin_unlock_irqrestore(&orig_hash_lock, flags);
 



More information about the commits mailing list