Author: simon Date: 2010-06-20 00:23:29 +0200 (Sun, 20 Jun 2010) New Revision: 1710
Modified: trunk/batman-adv-kernelland/translation-table.c Log: batman-adv: Avoid rounding issues for local hna timeout
With the current default values, this patch is not critical, as LOCAL_HNA_TIMEOUT is a multiple of 1000 anyway. However, if someone would like to change this #define, the person could have some unexpected rounding issues. Therefore doing the multiplication before the division now.
Signed-off-by: Linus L?\195?\188ssing linus.luessing@web.de Signed-off-by: Simon Wunderlich siwu@hrz.tu-chemnitz.de
Modified: trunk/batman-adv-kernelland/translation-table.c =================================================================== --- trunk/batman-adv-kernelland/translation-table.c 2010-06-19 13:09:59 UTC (rev 1709) +++ trunk/batman-adv-kernelland/translation-table.c 2010-06-19 22:23:29 UTC (rev 1710) @@ -259,7 +259,7 @@ hna_local_entry = hashit.bucket->data;
timeout = hna_local_entry->last_seen + - ((LOCAL_HNA_TIMEOUT / 1000) * HZ); + ((LOCAL_HNA_TIMEOUT * HZ) / 1000); if ((!hna_local_entry->never_purge) && time_after(jiffies, timeout)) hna_local_del(hna_local_entry, "address timed out");