diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-02-02 23:40:09 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-02-02 23:40:09 -0500 |
commit | 0dec456d1fe73e0539625f0973ee8ef8fb805943 (patch) | |
tree | 56d37da8d8e37154030d3f45224ae852195977e6 | |
parent | 6e2be3ea4fab4d1c02e369719311e8d7ae6cc7c1 (diff) |
[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: Stephen Hemminger <shemminger@osdl.org>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/sock.h | 8 | ||||
-rw-r--r-- | net/Kconfig | 7 |
2 files changed, 11 insertions, 4 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 1806e5b61419..30758035d616 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1354,12 +1354,12 @@ extern int sock_get_timestamp(struct sock *, struct timeval __user *); | |||
1354 | * Enable debug/info messages | 1354 | * Enable debug/info messages |
1355 | */ | 1355 | */ |
1356 | 1356 | ||
1357 | #if 0 | 1357 | #ifdef CONFIG_NETDEBUG |
1358 | #define NETDEBUG(fmt, args...) do { } while (0) | ||
1359 | #define LIMIT_NETDEBUG(fmt, args...) do { } while(0) | ||
1360 | #else | ||
1361 | #define NETDEBUG(fmt, args...) printk(fmt,##args) | 1358 | #define NETDEBUG(fmt, args...) printk(fmt,##args) |
1362 | #define LIMIT_NETDEBUG(fmt, args...) do { if (net_ratelimit()) printk(fmt,##args); } while(0) | 1359 | #define LIMIT_NETDEBUG(fmt, args...) do { if (net_ratelimit()) printk(fmt,##args); } while(0) |
1360 | #else | ||
1361 | #define NETDEBUG(fmt, args...) do { } while (0) | ||
1362 | #define LIMIT_NETDEBUG(fmt, args...) do { } while(0) | ||
1363 | #endif | 1363 | #endif |
1364 | 1364 | ||
1365 | /* | 1365 | /* |
diff --git a/net/Kconfig b/net/Kconfig index bc603d9aea56..5126f58d9c44 100644 --- a/net/Kconfig +++ b/net/Kconfig | |||
@@ -27,6 +27,13 @@ if NET | |||
27 | 27 | ||
28 | menu "Networking options" | 28 | menu "Networking options" |
29 | 29 | ||
30 | config NETDEBUG | ||
31 | bool "Network packet debugging" | ||
32 | help | ||
33 | You can say Y here if you want to get additional messages useful in | ||
34 | debugging bad packets, but can overwhelm logs under denial of service | ||
35 | attacks. | ||
36 | |||
30 | source "net/packet/Kconfig" | 37 | source "net/packet/Kconfig" |
31 | source "net/unix/Kconfig" | 38 | source "net/unix/Kconfig" |
32 | source "net/xfrm/Kconfig" | 39 | source "net/xfrm/Kconfig" |