From: Simon Wunderlich Date: Thu, 25 Apr 2013 08:37:26 +0000 (+0200) Subject: batman-adv: only add recordroute information to icmp request/reply X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=97dbc03b4776fbcfda99c4486357d28115d9adc0;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git batman-adv: only add recordroute information to icmp request/reply 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 --- diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 457dfef9c5fc..0dc1c0e84451 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);