batman-adv: send_*_tt_response() has to initialise the ttl field

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

Commit Message

Antonio Quartulli May 29, 2011, 6:54 p.m. UTC
  send_*_tt_response() didn't properly initialise the ttl field of the
tt_response message.

This error was introduced with: cea194d90b11aff7fc289149e4c7f305fad3535a

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

Comments

Marek Lindner May 29, 2011, 7:58 p.m. UTC | #1
On Sunday 29 May 2011 20:54:31 Antonio Quartulli wrote:
> send_*_tt_response() didn't properly initialise the ttl field of the
> tt_response message.
> 
> This error was introduced with: cea194d90b11aff7fc289149e4c7f305fad3535a

Applied in revision 7fbf38e.

Thanks,
Marek
  

Patch

diff --git a/translation-table.c b/translation-table.c
index f0d8857..f04ab9b 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -1132,6 +1132,7 @@  static bool send_other_tt_response(struct bat_priv *bat_priv,
 
 	tt_response->packet_type = BAT_TT_QUERY;
 	tt_response->version = COMPAT_VERSION;
+	tt_response->ttl = TTL;
 	memcpy(tt_response->src, req_dst_orig_node->orig, ETH_ALEN);
 	memcpy(tt_response->dst, tt_request->src, ETH_ALEN);
 	tt_response->tt_data = htons(tt_tot);
@@ -1280,6 +1281,7 @@  static bool send_my_tt_response(struct bat_priv *bat_priv,
 
 	tt_response->packet_type = BAT_TT_QUERY;
 	tt_response->version = COMPAT_VERSION;
+	tt_response->ttl = TTL;
 	memcpy(tt_response->src, primary_if->net_dev->dev_addr, ETH_ALEN);
 	memcpy(tt_response->dst, tt_request->src, ETH_ALEN);
 	tt_response->tt_data = htons(tt_tot);