Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 149de2e5 authored by Marek Lindner's avatar Marek Lindner Committed by Greg Kroah-Hartman
Browse files

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: default avatarMarek Lindner <lindner_marek@yahoo.de>
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent eb50081d
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -658,11 +658,12 @@ static int recv_icmp_ttl_exceeded(struct sk_buff *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);
@@ -825,7 +826,8 @@ int recv_unicast_packet(struct sk_buff *skb)

	/* 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;
	}