https://www.open-mesh.org/https://www.open-mesh.org/favicon.ico?16699090422012-09-06T06:42:14ZOpen Meshbatman-adv - Bug #164: Local translation table update on a bat0 MAC changehttps://www.open-mesh.org/issues/164?journal_id=2462012-09-06T06:42:14ZAntonio Quartulli
<ul></ul><p>Def D wrote:</p>
<blockquote>
<p>I think the addesse 36:aa:aa:aa:aa:aa is not tagged as NoPurged because the function <em>batadv_tt_local_add</em> is called before the update of mac addresse <em>memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);</em></p>
<p>I'm right ?</p>
</blockquote>
<p>Exactly. In tt_local_add() the code compares the new address with the bat0 one and if they are equal it adds the NoPurge flag.</p>
<p>We need to copy the address in 'dev->dev_addr' before invoking tt_local_add, but then we have to pay attention to invoke tt_loval_del with the correct argument.<br />are you going to send a patch to fix this?</p> batman-adv - Bug #164: Local translation table update on a bat0 MAC changehttps://www.open-mesh.org/issues/164?journal_id=2472012-09-06T10:03:57ZDef Ddef@laposte.net
<ul><li><strong>File</strong> <a href="/attachments/282">batman-adv_001_fix_softiface_mac_update.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/282/batman-adv_001_fix_softiface_mac_update.patch">batman-adv_001_fix_softiface_mac_update.patch</a> added</li><li><strong>File</strong> <a href="/attachments/283">batman-adv_002_fix_softiface_mac_update_remove_old_tt_entry.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/283/batman-adv_002_fix_softiface_mac_update_remove_old_tt_entry.patch">batman-adv_002_fix_softiface_mac_update_remove_old_tt_entry.patch</a> added</li></ul><p>Antonio Quartulli wrote:</p>
<blockquote>
<p>We need to copy the address in 'dev->dev_addr' before invoking tt_local_add, but then we have to pay attention to invoke tt_loval_del with the correct argument.</p>
</blockquote>
<p>Thank you</p>
<p>Antonio Quartulli wrote:</p>
<blockquote>
<p>are you going to send a patch to fix this?</p>
</blockquote>
<p>I can try</p>
<ul>
<li>batman-adv_001_fix_softiface_mac_update.patch<br />Update <em>dev->dev_addr</em> before calling <em>tt_local_add</em> into function <em>interface_set_mac_addr</em></li>
</ul>
<ul>
<li>batman-adv_002_fix_softiface_mac_update_remove_old_tt_entry.patch<br />To allow removing old MAC addresse: Add argument <em>force</em> in function <em>tt_local_remove</em> to remove flag <em>NoPurge</em></li>
</ul>
<p>Tested on my boards.</p>
<p>It is fine ?</p> batman-adv - Bug #164: Local translation table update on a bat0 MAC changehttps://www.open-mesh.org/issues/164?journal_id=2482012-09-06T10:59:32ZAntonio Quartulli
<ul></ul><p>I don't think we really need Patch 002. The NOPURGE flag is used only to avoid to purge the entry in case of timeout, therefore in this case the deletion will happen anyway.<br />For patch 001, instead of adding an else branch, what about storing the old mac in a local variable, passing it to the tt_local_del and so moving the memcpy before the if-loop?</p>
<p>By the way, now I think it would be better to use the git-format-patch and send it over the ml.</p> batman-adv - Bug #164: Local translation table update on a bat0 MAC changehttps://www.open-mesh.org/issues/164?journal_id=2492012-09-10T16:43:44ZDef Ddef@laposte.net
<ul></ul><ul>
<li>Patch 001<br />Using a local variable to store old MAC address use a memcpy that can be avoided.<br />The else branch introduce a duplicate memcpy code to update dev->dev_addr, but it is more optimized. isnt it ?</li>
</ul>
<ul>
<li>Patch 002<br />Ok, I understand why the patch is not relevant.</li>
</ul> batman-adv - Bug #164: Local translation table update on a bat0 MAC changehttps://www.open-mesh.org/issues/164?journal_id=2512012-09-19T15:43:17ZDef Ddef@laposte.net
<ul><li><strong>File</strong> <a href="/attachments/285">batman-adv_001_fix_softiface_mac_update_v2.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/285/batman-adv_001_fix_softiface_mac_update_v2.patch">batman-adv_001_fix_softiface_mac_update_v2.patch</a> added</li></ul><p>Antonio Quartulli wrote:</p>
<blockquote>
<p>For patch 001, instead of adding an else branch, what about storing the old mac in a local variable, passing it to the tt_local_del and so moving the memcpy before the if-loop?</p>
</blockquote>
<p>I did as you suggested.</p>
<p>Using git-format-patch.</p>
<p>I will (re)send to mailing list.</p> batman-adv - Bug #164: Local translation table update on a bat0 MAC changehttps://www.open-mesh.org/issues/164?journal_id=2632012-11-10T16:08:17ZAntonio Quartulli
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li></ul> batman-adv - Bug #164: Local translation table update on a bat0 MAC changehttps://www.open-mesh.org/issues/164?journal_id=3342013-08-31T18:42:22ZAntonio Quartulli
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul> batman-adv - Bug #164: Local translation table update on a bat0 MAC changehttps://www.open-mesh.org/issues/164?journal_id=10942017-02-11T08:18:20ZSven Eckelmann
<ul><li><strong>Target version</strong> set to <i>2012.4.0</i></li></ul>