Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: add CONFIG_DEBUG_NET

This config option enables network debugging checks.

This patch adds DEBUG_NET_WARN_ON_ONCE(cond)
Note that this is not a replacement for WARN_ON_ONCE(cond)
as (cond) is not evaluated if CONFIG_DEBUG_NET is not set.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
d268c1f5 5b87be9e

+13
+6
include/net/net_debug.h
··· 148 148 #endif 149 149 150 150 151 + #if defined(CONFIG_DEBUG_NET) 152 + #define DEBUG_NET_WARN_ON_ONCE(cond) (void)WARN_ON_ONCE(cond) 153 + #else 154 + #define DEBUG_NET_WARN_ON_ONCE(cond) BUILD_BUG_ON_INVALID(cond) 155 + #endif 156 + 151 157 #endif /* _LINUX_NET_DEBUG_H */
+7
net/Kconfig.debug
··· 17 17 help 18 18 Enable debugging feature to track netns references. 19 19 This adds memory and cpu costs. 20 + 21 + config DEBUG_NET 22 + bool "Add generic networking debug" 23 + depends on DEBUG_KERNEL 24 + help 25 + Enable extra sanity checks in networking. 26 + This is mostly used by fuzzers, but is safe to select.