Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
commit d078de322df4be35651333070f6eb6f377181416 Author: Simon Wunderlich simon@open-mesh.com Date: Fri Nov 22 13:02:07 2013 +0100
batman-adv: fix orig_node multiif regression in network coding
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 Signed-off-by: Marek Lindner mareklindner@neomailbox.ch
d078de322df4be35651333070f6eb6f377181416 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; + + 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 (orig_node->last_ttl != ogm_packet->header.ttl + 1) + if (last_ttl != ogm_packet->header.ttl + 1) return false; if (!batadv_compare_eth(ogm_packet->orig, ogm_packet->prev_sender)) return false;