Author: marek Date: 2010-08-20 21:16:09 +0200 (Fri, 20 Aug 2010) New Revision: 1773
Modified: trunk/batman-adv/compat.h trunk/batman-adv/routing.c trunk/batman-adv/vis.c Log: batman-adv: Don't inform about dropped packets in nodebug
Information about dropped packets are usually only interesting for debugging purposes and otherwise open the possibility to flood the logs of the target machine with useless information.
pr_debug will not output those information on a nodebug kernel.
Reported-by: Vasiliy Kulikov segooon@gmail.com Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de
Modified: trunk/batman-adv/compat.h =================================================================== --- trunk/batman-adv/compat.h 2010-08-20 19:16:07 UTC (rev 1772) +++ trunk/batman-adv/compat.h 2010-08-20 19:16:09 UTC (rev 1773) @@ -90,6 +90,14 @@ #define pr_warning(fmt, ...) \ printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
+#if defined(DEBUG) +#define pr_debug(fmt, ...) \ + printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_debug(fmt, ...) \ + ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) +#endif + #define dev_get_by_name(x, y) dev_get_by_name(y)
#endif /* < KERNEL_VERSION(2, 6, 24) */
Modified: trunk/batman-adv/routing.c =================================================================== --- trunk/batman-adv/routing.c 2010-08-20 19:16:07 UTC (rev 1772) +++ trunk/batman-adv/routing.c 2010-08-20 19:16:09 UTC (rev 1773) @@ -871,9 +871,9 @@
/* send TTL exceeded if packet is an echo request (traceroute) */ if (icmp_packet->msg_type != ECHO_REQUEST) { - pr_warning("Warning - can't forward icmp packet from %pM to " - "%pM: ttl exceeded\n", icmp_packet->orig, - icmp_packet->dst); + pr_debug("Warning - can't forward icmp packet from %pM to " + "%pM: ttl exceeded\n", icmp_packet->orig, + icmp_packet->dst); return NET_RX_DROP; }
@@ -1153,9 +1153,9 @@
/* TTL exceeded */ if (unicast_packet->ttl < 2) { - pr_warning("Warning - can't forward unicast packet from %pM to " - "%pM: ttl exceeded\n", ethhdr->h_source, - unicast_packet->dest); + pr_debug("Warning - can't forward unicast packet from %pM to " + "%pM: ttl exceeded\n", ethhdr->h_source, + unicast_packet->dest); return NET_RX_DROP; }
@@ -1236,8 +1236,7 @@ hash_find(bat_priv->orig_hash, unicast_packet->orig));
if (!orig_node) { - pr_warning("couldn't find orig node for " - "fragmentation\n"); + pr_debug("couldn't find orig node for fragmentation\n"); spin_unlock_irqrestore(&bat_priv->orig_hash_lock, flags); return NET_RX_DROP;
Modified: trunk/batman-adv/vis.c =================================================================== --- trunk/batman-adv/vis.c 2010-08-20 19:16:07 UTC (rev 1772) +++ trunk/batman-adv/vis.c 2010-08-20 19:16:09 UTC (rev 1773) @@ -746,7 +746,7 @@
packet = (struct vis_packet *)info->skb_packet->data; if (packet->ttl < 2) { - pr_warning("Error - can't send vis packet: ttl exceeded\n"); + pr_debug("Error - can't send vis packet: ttl exceeded\n"); return; }