Commit 0dec456d authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[NET]: Add CONFIG_NETDEBUG to suppress bad packet messages.

If you are on a hostile network, or are running protocol tests, you can
easily get the logged swamped by messages about bad UDP and ICMP packets.
This turns those messages off unless a config option is enabled.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Acked-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6e2be3ea
...@@ -1354,12 +1354,12 @@ extern int sock_get_timestamp(struct sock *, struct timeval __user *); ...@@ -1354,12 +1354,12 @@ extern int sock_get_timestamp(struct sock *, struct timeval __user *);
* Enable debug/info messages * Enable debug/info messages
*/ */
#if 0 #ifdef CONFIG_NETDEBUG
#define NETDEBUG(fmt, args...) do { } while (0)
#define LIMIT_NETDEBUG(fmt, args...) do { } while(0)
#else
#define NETDEBUG(fmt, args...) printk(fmt,##args) #define NETDEBUG(fmt, args...) printk(fmt,##args)
#define LIMIT_NETDEBUG(fmt, args...) do { if (net_ratelimit()) printk(fmt,##args); } while(0) #define LIMIT_NETDEBUG(fmt, args...) do { if (net_ratelimit()) printk(fmt,##args); } while(0)
#else
#define NETDEBUG(fmt, args...) do { } while (0)
#define LIMIT_NETDEBUG(fmt, args...) do { } while(0)
#endif #endif
/* /*
......
...@@ -27,6 +27,13 @@ if NET ...@@ -27,6 +27,13 @@ if NET
menu "Networking options" menu "Networking options"
config NETDEBUG
bool "Network packet debugging"
help
You can say Y here if you want to get additional messages useful in
debugging bad packets, but can overwhelm logs under denial of service
attacks.
source "net/packet/Kconfig" source "net/packet/Kconfig"
source "net/unix/Kconfig" source "net/unix/Kconfig"
source "net/xfrm/Kconfig" source "net/xfrm/Kconfig"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment