aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2010-02-19 10:18:06 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-03 19:43:02 -0500
commit149de2e58b53cb87c9637a46441c477f0caf74bd (patch)
tree3c6cd7e4aa5d6847b1a77fecab4442da6df2ca16
parenteb50081d8fb76d5de9d65628d7f41977ece7044b (diff)
Staging: 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> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/batman-adv/routing.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/staging/batman-adv/routing.c b/drivers/staging/batman-adv/routing.c
index 09917e57b41c..8abaa6193ac3 100644
--- a/drivers/staging/batman-adv/routing.c
+++ b/drivers/staging/batman-adv/routing.c
@@ -655,14 +655,15 @@ static int recv_icmp_ttl_exceeded(struct sk_buff *skb)
655 unsigned long flags; 655 unsigned long flags;
656 uint8_t dstaddr[ETH_ALEN]; 656 uint8_t dstaddr[ETH_ALEN];
657 657
658 icmp_packet = (struct icmp_packet *) skb->data; 658 icmp_packet = (struct icmp_packet *)skb->data;
659 ethhdr = (struct ethhdr *) skb_mac_header(skb); 659 ethhdr = (struct ethhdr *)skb_mac_header(skb);
660
661 printk(KERN_WARNING "batman-adv:Warning - can't send packet from %pM to %pM: ttl exceeded\n", icmp_packet->orig, icmp_packet->dst);
662 660
663 /* send TTL exceeded if packet is an echo request (traceroute) */ 661 /* send TTL exceeded if packet is an echo request (traceroute) */
664 if (icmp_packet->msg_type != ECHO_REQUEST) 662 if (icmp_packet->msg_type != ECHO_REQUEST) {
663 printk(KERN_WARNING "batman-adv:Warning - can't forward icmp packet from %pM to %pM: ttl exceeded\n",
664 icmp_packet->orig, icmp_packet->dst);
665 return NET_RX_DROP; 665 return NET_RX_DROP;
666 }
666 667
667 /* get routing information */ 668 /* get routing information */
668 spin_lock_irqsave(&orig_hash_lock, flags); 669 spin_lock_irqsave(&orig_hash_lock, flags);
@@ -825,7 +826,8 @@ int recv_unicast_packet(struct sk_buff *skb)
825 826
826 /* TTL exceeded */ 827 /* TTL exceeded */
827 if (unicast_packet->ttl < 2) { 828 if (unicast_packet->ttl < 2) {
828 printk(KERN_WARNING "batman-adv:Warning - can't send packet from %pM to %pM: ttl exceeded\n", ethhdr->h_source, unicast_packet->dest); 829 printk(KERN_WARNING "batman-adv:Warning - can't forward unicast packet from %pM to %pM: ttl exceeded\n",
830 ethhdr->h_source, unicast_packet->dest);
829 return NET_RX_DROP; 831 return NET_RX_DROP;
830 } 832 }
831 833