summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-03-08 20:41:08 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-25 22:24:05 -0700
commita2a316fd068c455c609ecc155dcfaa7e208d29fe (patch)
tree9839e2c7e05e9d25241fa7c7b27fd06214120292 /include/net
parentae40eb1ef30ab4120bd3c8b7e3da99ee53d27a23 (diff)
[NET]: Replace CONFIG_NET_DEBUG with sysctl.
Covert network warning messages from a compile time to runtime choice. Removes kernel config option and replaces it with new /proc/sys/net/core/warnings. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/sock.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index d093e49fdc85..51246579592e 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1334,14 +1334,12 @@ extern int sock_get_timestampns(struct sock *, struct timespec __user *);
/*
* Enable debug/info messages
*/
+extern int net_msg_warn;
+#define NETDEBUG(fmt, args...) \
+ do { if (net_msg_warn) printk(fmt,##args); } while (0)
-#ifdef CONFIG_NETDEBUG
-#define NETDEBUG(fmt, args...) printk(fmt,##args)
-#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
+#define LIMIT_NETDEBUG(fmt, args...) \
+ do { if (net_msg_warn && net_ratelimit()) printk(fmt,##args); } while(0)
/*
* Macros for sleeping on a socket. Use them like this: