b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Subject: [B.A.T.M.A.N.] [PATCHv4 6/6] batman-adv: only add recordroute information to icmp request/reply
Date: Thu, 25 Apr 2013 10:37:26 +0200	[thread overview]
Message-ID: <1366879046-24507-7-git-send-email-siwu@hrz.tu-chemnitz.de> (raw)
In-Reply-To: <1366879046-24507-1-git-send-email-siwu@hrz.tu-chemnitz.de>

Adding host information for record route is only required for ICMP
requests and replys, and should not be added to just any (future?)
packet type.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
 routing.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/routing.c b/routing.c
index 3f5802c..7c372f1 100644
--- a/routing.c
+++ b/routing.c
@@ -379,7 +379,9 @@ int batadv_recv_icmp_packet(struct sk_buff *skb,
 	icmp_packet = (struct batadv_icmp_packet_rr *)skb->data;
 
 	/* add record route information if not full */
-	if ((hdr_size == sizeof(struct batadv_icmp_packet_rr)) &&
+	if ((icmp_packet->msg_type == BATADV_ECHO_REPLY ||
+	     icmp_packet->msg_type == BATADV_ECHO_REQUEST) &&
+	    (hdr_size == sizeof(struct batadv_icmp_packet_rr)) &&
 	    (icmp_packet->rr_cur < BATADV_RR_LEN)) {
 		memcpy(&(icmp_packet->rr[icmp_packet->rr_cur]),
 		       ethhdr->h_dest, ETH_ALEN);
-- 
1.7.10.4


  parent reply	other threads:[~2013-04-25  8:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-25  8:37 [B.A.T.M.A.N.] [PATCHv4 0/6] compat bump work Simon Wunderlich
2013-04-25  8:37 ` [B.A.T.M.A.N.] [PATCHv4 1/6] batman-adv: remove vis functionality Simon Wunderlich
2013-04-25  8:37 ` [B.A.T.M.A.N.] [PATCHv4 2/6] batman-adv: add build check macros for packet member offset Simon Wunderlich
2013-04-27  5:33   ` Marek Lindner
2013-04-25  8:37 ` [B.A.T.M.A.N.] [PATCHv4 3/6] batman-adv: reorder packet types Simon Wunderlich
2013-04-27  5:44   ` Marek Lindner
2013-04-25  8:37 ` [B.A.T.M.A.N.] [PATCHv4 4/6] batman-adv: remove packed from batadv_ogm_packet Simon Wunderlich
2013-04-27  5:47   ` Marek Lindner
2013-04-25  8:37 ` [B.A.T.M.A.N.] [PATCHv4 5/6] batman-adv: reorder batadv_iv_flags Simon Wunderlich
2013-04-27  5:53   ` Marek Lindner
2013-04-25  8:37 ` Simon Wunderlich [this message]
2013-04-27  5:54   ` [B.A.T.M.A.N.] [PATCHv4 6/6] batman-adv: only add recordroute information to icmp request/reply Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366879046-24507-7-git-send-email-siwu@hrz.tu-chemnitz.de \
    --to=simon.wunderlich@s2003.tu-chemnitz.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=siwu@hrz.tu-chemnitz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).