batman-adv: unset the TT_CLIENT_PENDING flag if the new local entry already exists

Message ID 1326670618-3950-1-git-send-email-ordex@autistici.org (mailing list archive)
State Accepted, archived
Commit 7e7fc81375bfbcf00688968a53b63f5227bfac48
Headers

Commit Message

Antonio Quartulli Jan. 15, 2012, 11:36 p.m. UTC
  When trying to add a new tt_local_entry, if such entry already exists, we have
to ensure that the TT_CLIENT_PENDING flag is not set, otherwise the entry will
be deleted soon.

Reported-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 translation-table.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
  

Comments

Marek Lindner April 4, 2012, 9:18 a.m. UTC | #1
On Monday, January 16, 2012 00:36:58 Antonio Quartulli wrote:
> When trying to add a new tt_local_entry, if such entry already exists, we
> have to ensure that the TT_CLIENT_PENDING flag is not set, otherwise the
> entry will be deleted soon.

Applied in revision 7e7fc81.

Thanks,
Marek
  

Patch

diff --git a/translation-table.c b/translation-table.c
index 27753a0..65de6b7 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -188,6 +188,8 @@  void tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
 
 	if (tt_local_entry) {
 		tt_local_entry->last_seen = jiffies;
+		/* possibly unset the TT_CLIENT_PENDING flag */
+		tt_local_entry->common.flags &= ~TT_CLIENT_PENDING;
 		goto out;
 	}