aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/routing.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv/routing.c')
-rw-r--r--net/batman-adv/routing.c4
1 files changed, 3 insertions, 1 deletions
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,
379 icmp_packet = (struct batadv_icmp_packet_rr *)skb->data; 379 icmp_packet = (struct batadv_icmp_packet_rr *)skb->data;
380 380
381 /* add record route information if not full */ 381 /* add record route information if not full */
382 if ((hdr_size == sizeof(struct batadv_icmp_packet_rr)) && 382 if ((icmp_packet->msg_type == BATADV_ECHO_REPLY ||
383 icmp_packet->msg_type == BATADV_ECHO_REQUEST) &&
384 (hdr_size == sizeof(struct batadv_icmp_packet_rr)) &&
383 (icmp_packet->rr_cur < BATADV_RR_LEN)) { 385 (icmp_packet->rr_cur < BATADV_RR_LEN)) {
384 memcpy(&(icmp_packet->rr[icmp_packet->rr_cur]), 386 memcpy(&(icmp_packet->rr[icmp_packet->rr_cur]),
385 ethhdr->h_dest, ETH_ALEN); 387 ethhdr->h_dest, ETH_ALEN);