Repository : ssh://git@open-mesh.org/batman-adv
Branch 'next' now includes:
db13d36 batman-adv: fix TT-TVLV parsing on OGM reception
dc08c04 batman-adv: release vlan object after checking the CRC
fedc76c Merge branch 'maint' into next
Repository : ssh://git@open-mesh.org/batman-adv
On branch : maint
>---------------------------------------------------------------
commit dc08c045b46bdd9a5c81068a89f9f2a78d3d4bbd
Author: Antonio Quartulli <antonio(a)meshcoding.com>
Date: Tue Jan 28 02:06:47 2014 +0100
batman-adv: release vlan object after checking the CRC
There is a refcounter unbalance in the CRC checking routine
invoked on OGM reception. A vlan object is retrieved (thus
its refcounter is increased by one) but it is never properly
released. This leads to a memleak because the vlan object
will never be free'd.
Fix this by releasing the vlan object after having read the
CRC.
Reported-by: Russell Senior <russell(a)personaltelco.net>
Reported-by: Daniel <daniel(a)makrotopia.org>
Reported-by: cmsv <cmsv(a)wirelesspt.net>
Signed-off-by: Antonio Quartulli <antonio(a)meshcoding.com>
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
>---------------------------------------------------------------
dc08c045b46bdd9a5c81068a89f9f2a78d3d4bbd
translation-table.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/translation-table.c b/translation-table.c
index 45b6155..05c2a9b 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -2248,6 +2248,7 @@ static bool batadv_tt_global_check_crc(struct batadv_orig_node *orig_node,
{
struct batadv_tvlv_tt_vlan_data *tt_vlan_tmp;
struct batadv_orig_node_vlan *vlan;
+ uint32_t crc;
int i;
/* check if each received CRC matches the locally stored one */
@@ -2267,7 +2268,10 @@ static bool batadv_tt_global_check_crc(struct batadv_orig_node *orig_node,
if (!vlan)
return false;
- if (vlan->tt.crc != ntohl(tt_vlan_tmp->crc))
+ crc = vlan->tt.crc;
+ batadv_orig_node_vlan_free_ref(vlan);
+
+ if (crc != ntohl(tt_vlan_tmp->crc))
return false;
}
Repository : ssh://git@open-mesh.org/batman-adv
On branch : maint
>---------------------------------------------------------------
commit db13d361ff6abf57090acfdeb0f5cedd8dd7f02e
Author: Antonio Quartulli <antonio(a)meshcoding.com>
Date: Mon Jan 27 12:23:28 2014 +0100
batman-adv: fix TT-TVLV parsing on OGM reception
When accessing a TT-TVLV container in the OGM RX path
the variable pointing to the list of changes to apply is
altered by mistake.
This makes the TT component read data at the wrong position
in the OGM packet buffer.
Fix it by removing the bogus pointer alteration.
Signed-off-by: Antonio Quartulli <antonio(a)meshcoding.com>
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
>---------------------------------------------------------------
db13d361ff6abf57090acfdeb0f5cedd8dd7f02e
translation-table.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/translation-table.c b/translation-table.c
index 3fca99d..45b6155 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -3204,7 +3204,6 @@ static void batadv_tt_update_orig(struct batadv_priv *bat_priv,
spin_lock_bh(&orig_node->tt_lock);
- tt_change = (struct batadv_tvlv_tt_change *)tt_buff;
batadv_tt_update_changes(bat_priv, orig_node, tt_num_changes,
ttvn, tt_change);