From patchwork Sun Oct 13 11:22:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 3448 Return-Path: Received: from s3.neomailbox.net (s3.neomailbox.net [178.209.62.157]) by open-mesh.org (Postfix) with ESMTPS id C276960227C for ; Sun, 13 Oct 2013 13:24:19 +0200 (CEST) From: Antonio Quartulli To: davem@davemloft.net Date: Sun, 13 Oct 2013 13:22:46 +0200 Message-Id: <1381663381-626-2-git-send-email-antonio@meshcoding.com> In-Reply-To: <1381663381-626-1-git-send-email-antonio@meshcoding.com> References: <1381663381-626-1-git-send-email-antonio@meshcoding.com> Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Simon Wunderlich , Antonio Quartulli , Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH 01/16] batman-adv: only add recordroute information to icmp request/reply X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Oct 2013 11:24:19 -0000 From: Simon Wunderlich 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 Signed-off-by: Marek Lindner Signed-off-by: Antonio Quartulli --- net/batman-adv/routing.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 457dfef..0dc1c0e 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/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);