public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: fix neigh_node multiif regression in network coding
@ 2013-11-22 12:02 Simon Wunderlich
  2013-11-22 12:02 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: fix orig_node " Simon Wunderlich
  2013-11-23 16:33 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: fix neigh_node " Marek Lindner
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Wunderlich @ 2013-11-22 12:02 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Simon Wunderlich

From: Simon Wunderlich <simon@open-mesh.com>

A previous commit for the multi interface optimization did not
change the member access for neigh_node to their respective new ifinfo
structures for the network coding implementation.

This was introduced by change 9bb33b8d88e318c4879d37d06ad28e3e018b9036
("batman-adv: split tq information in neigh_node struct")

Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
---
 network-coding.c |   24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/network-coding.c b/network-coding.c
index 0b35e9e..8678448 100644
--- a/network-coding.c
+++ b/network-coding.c
@@ -1005,6 +1005,8 @@ static bool batadv_nc_code_packets(struct batadv_priv *bat_priv,
 	struct batadv_coded_packet *coded_packet;
 	struct batadv_neigh_node *neigh_tmp, *router_neigh;
 	struct batadv_neigh_node *router_coding = NULL;
+	struct batadv_neigh_ifinfo *router_neigh_ifinfo = NULL;
+	struct batadv_neigh_ifinfo *router_coding_ifinfo = NULL;
 	uint8_t *first_source, *first_dest, *second_source, *second_dest;
 	__be32 packet_id1, packet_id2;
 	size_t count;
@@ -1022,16 +1024,26 @@ static bool batadv_nc_code_packets(struct batadv_priv *bat_priv,
 	if (!router_neigh)
 		goto out;
 
+	router_neigh_ifinfo = batadv_neigh_ifinfo_get(router_neigh,
+						      BATADV_IF_DEFAULT);
+	if (!router_neigh_ifinfo)
+		goto out;
+
 	neigh_tmp = nc_packet->neigh_node;
 	router_coding = batadv_orig_router_get(neigh_tmp->orig_node,
 					       BATADV_IF_DEFAULT);
 	if (!router_coding)
 		goto out;
 
-	tq_tmp = batadv_nc_random_weight_tq(router_neigh->bat_iv.tq_avg);
-	tq_weighted_neigh = tq_tmp;
-	tq_tmp = batadv_nc_random_weight_tq(router_coding->bat_iv.tq_avg);
-	tq_weighted_coding = tq_tmp;
+	router_coding_ifinfo = batadv_neigh_ifinfo_get(router_coding,
+						       BATADV_IF_DEFAULT);
+	if (!router_coding_ifinfo)
+		goto out;
+
+	tq_tmp = router_neigh_ifinfo->bat_iv.tq_avg;
+	tq_weighted_neigh = batadv_nc_random_weight_tq(tq_tmp);
+	tq_tmp = router_coding_ifinfo->bat_iv.tq_avg;
+	tq_weighted_coding = batadv_nc_random_weight_tq(tq_tmp);
 
 	/* Select one destination for the MAC-header dst-field based on
 	 * weighted TQ-values.
@@ -1155,6 +1167,10 @@ out:
 		batadv_neigh_node_free_ref(router_neigh);
 	if (router_coding)
 		batadv_neigh_node_free_ref(router_coding);
+	if (router_neigh_ifinfo)
+		batadv_neigh_ifinfo_free_ref(router_neigh_ifinfo);
+	if (router_coding_ifinfo)
+		batadv_neigh_ifinfo_free_ref(router_coding_ifinfo);
 	return res;
 }
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: fix orig_node multiif regression in network coding
  2013-11-22 12:02 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: fix neigh_node multiif regression in network coding Simon Wunderlich
@ 2013-11-22 12:02 ` Simon Wunderlich
  2013-11-23 16:35   ` Marek Lindner
  2013-11-23 16:33 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: fix neigh_node " Marek Lindner
  1 sibling, 1 reply; 4+ messages in thread
From: Simon Wunderlich @ 2013-11-22 12:02 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Simon Wunderlich

From: Simon Wunderlich <simon@open-mesh.com>

A previous commit for the multi interface optimization did not
change the member access for orig_node to their respective new ifinfo
structures for the network coding implementation.

This was introduced by change de6bcc76ea84fecb136f8c8f5ba1862e4a13f06b
("batman-adv: split out router from orig_node")

Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
---
 network-coding.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/network-coding.c b/network-coding.c
index 8678448..b2fde56 100644
--- a/network-coding.c
+++ b/network-coding.c
@@ -715,9 +715,21 @@ static bool batadv_can_nc_with_orig(struct batadv_priv *bat_priv,
 				    struct batadv_orig_node *orig_node,
 				    struct batadv_ogm_packet *ogm_packet)
 {
-	if (orig_node->last_real_seqno != ntohl(ogm_packet->seqno))
+	struct batadv_orig_ifinfo *orig_ifinfo;
+	uint32_t last_real_seqno;
+	uint8_t last_ttl;
+
+	orig_ifinfo = batadv_orig_ifinfo_get(orig_node, BATADV_IF_DEFAULT);
+	if (!orig_ifinfo)
 		return false;
-	if (orig_node->last_ttl != ogm_packet->header.ttl + 1)
+
+	last_ttl = orig_ifinfo->last_ttl;
+	last_real_seqno = orig_ifinfo->last_real_seqno;
+	batadv_orig_ifinfo_free_ref(orig_ifinfo);
+
+	if (last_real_seqno != ntohl(ogm_packet->seqno))
+		return false;
+	if (last_ttl != ogm_packet->header.ttl + 1)
 		return false;
 	if (!batadv_compare_eth(ogm_packet->orig, ogm_packet->prev_sender))
 		return false;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: fix neigh_node multiif regression in network coding
  2013-11-22 12:02 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: fix neigh_node multiif regression in network coding Simon Wunderlich
  2013-11-22 12:02 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: fix orig_node " Simon Wunderlich
@ 2013-11-23 16:33 ` Marek Lindner
  1 sibling, 0 replies; 4+ messages in thread
From: Marek Lindner @ 2013-11-23 16:33 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Simon Wunderlich

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]

On Friday 22 November 2013 13:02:06 Simon Wunderlich wrote:
> From: Simon Wunderlich <simon@open-mesh.com>
> 
> A previous commit for the multi interface optimization did not
> change the member access for neigh_node to their respective new ifinfo
> structures for the network coding implementation.
> 
> This was introduced by change 9bb33b8d88e318c4879d37d06ad28e3e018b9036
> ("batman-adv: split tq information in neigh_node struct")
> 
> Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
> ---
>  network-coding.c |   24 ++++++++++++++++++++----
>  1 file changed, 20 insertions(+), 4 deletions(-)

Applied in revision cb7ec5f.

Thanks,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: fix orig_node multiif regression in network coding
  2013-11-22 12:02 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: fix orig_node " Simon Wunderlich
@ 2013-11-23 16:35   ` Marek Lindner
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Lindner @ 2013-11-23 16:35 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Simon Wunderlich

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

On Friday 22 November 2013 13:02:07 Simon Wunderlich wrote:
> From: Simon Wunderlich <simon@open-mesh.com>
> 
> A previous commit for the multi interface optimization did not
> change the member access for orig_node to their respective new ifinfo
> structures for the network coding implementation.
> 
> This was introduced by change de6bcc76ea84fecb136f8c8f5ba1862e4a13f06b
> ("batman-adv: split out router from orig_node")
> 
> Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
> ---
>  network-coding.c |   16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)

Applied in revision d078de3.

Thanks,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-23 16:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-22 12:02 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: fix neigh_node multiif regression in network coding Simon Wunderlich
2013-11-22 12:02 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: fix orig_node " Simon Wunderlich
2013-11-23 16:35   ` Marek Lindner
2013-11-23 16:33 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: fix neigh_node " Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox