[v2,1/3] batman-adv: initialise last_ttvn and tt_crc for the orig_node structure

Message ID 1309995659-19126-2-git-send-email-ordex@autistici.org (mailing list archive)
State Superseded, archived
Headers

Commit Message

Antonio Quartulli July 6, 2011, 11:40 p.m. UTC
  The last_ttvn and tt_crc fields of the orig_node structure were not
initialised causing an immediate TT_REQ/RES dialogue even if not needed.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 originator.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
  

Comments

Marek Lindner July 7, 2011, 11:35 a.m. UTC | #1
On Thursday, July 07, 2011 01:40:57 Antonio Quartulli wrote:
> The last_ttvn and tt_crc fields of the orig_node structure were not
> initialised causing an immediate TT_REQ/RES dialogue even if not needed.

Applied in revision c9007e1.

Thanks,
Marek
  

Patch

diff --git a/originator.c b/originator.c
index 338b3c5..4aa115f 100644
--- a/originator.c
+++ b/originator.c
@@ -223,6 +223,8 @@  struct orig_node *get_orig_node(struct bat_priv *bat_priv, const uint8_t *addr)
 	orig_node->bat_priv = bat_priv;
 	memcpy(orig_node->orig, addr, ETH_ALEN);
 	orig_node->router = NULL;
+	orig_node->tt_crc = 0;
+	atomic_set(&orig_node->last_ttvn, 0);
 	orig_node->tt_buff = NULL;
 	orig_node->tt_buff_len = 0;
 	atomic_set(&orig_node->tt_size, 0);