diff options
author | Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de> | 2013-04-25 04:37:26 -0400 |
---|---|---|
committer | Antonio Quartulli <antonio@meshcoding.com> | 2013-10-12 03:51:26 -0400 |
commit | 97dbc03b4776fbcfda99c4486357d28115d9adc0 (patch) | |
tree | 78b464f2a1afe1914a2095f7fa8ec0dbfc4af7a5 /net/batman-adv | |
parent | ccdbb6e96beca362db876d820ac1e560ff6d9579 (diff) |
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 <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/routing.c | 4 |
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); |