Author: marek Date: 2010-01-17 07:55:47 +0100 (Sun, 17 Jan 2010) New Revision: 1550
Modified: trunk/batman-adv-kernelland/routing.c Log: batman-adv: avoid having the same error message more than once
The routing code has 2 sections which warn about ttl exceeded. The corresponding warnings were identical which makes it hard to debug. In addition, batman-adv does not need to warn about ttl exceeded in case we encountered an echo request as this is commonly used to generate traceroute graphs.
Signed-off-by: Marek Lindner lindner_marek@yahoo.de
Modified: trunk/batman-adv-kernelland/routing.c =================================================================== --- trunk/batman-adv-kernelland/routing.c 2010-01-10 04:00:09 UTC (rev 1549) +++ trunk/batman-adv-kernelland/routing.c 2010-01-17 06:55:47 UTC (rev 1550) @@ -667,14 +667,15 @@ unsigned long flags; uint8_t dstaddr[ETH_ALEN];
- icmp_packet = (struct icmp_packet *) skb->data; - ethhdr = (struct ethhdr *) skb_mac_header(skb); + icmp_packet = (struct icmp_packet *)skb->data; + ethhdr = (struct ethhdr *)skb_mac_header(skb);
- printk(KERN_WARNING "batman-adv:Warning - can't send packet from %pM to %pM: ttl exceeded\n", icmp_packet->orig, icmp_packet->dst); - /* send TTL exceeded if packet is an echo request (traceroute) */ - if (icmp_packet->msg_type != ECHO_REQUEST) + if (icmp_packet->msg_type != ECHO_REQUEST) { + printk(KERN_WARNING "batman-adv:Warning - can't forward icmp packet from %pM to %pM: ttl exceeded\n", + icmp_packet->orig, icmp_packet->dst); return NET_RX_DROP; + }
/* get routing information */ spin_lock_irqsave(&orig_hash_lock, flags); @@ -754,11 +755,9 @@ return recv_my_icmp_packet(skb);
/* TTL exceeded */ - if (icmp_packet->ttl < 2) { + if (icmp_packet->ttl < 2) return recv_icmp_ttl_exceeded(skb);
- } - ret = NET_RX_DROP;
/* get routing information */ @@ -839,7 +838,7 @@
/* TTL exceeded */ if (unicast_packet->ttl < 2) { - printk(KERN_WARNING "batman-adv:Warning - can't send packet from %pM to %pM: ttl exceeded\n", ethhdr->h_source, unicast_packet->dest); + printk(KERN_WARNING "batman-adv:Warning - can't forward unicast packet from %pM to %pM: ttl exceeded\n", ethhdr->h_source, unicast_packet->dest); return NET_RX_DROP; }