瀏覽代碼

netfilter: change NF_ASSERT to WARN_ON

Change netfilter asserts to standard WARN_ON. This has the
benefit of backtrace info and also causes netfilter errors
to show up on kerneloops.org.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Stephen Hemminger 15 年之前
父節點
當前提交
af5676039a
共有 3 個文件被更改,包括 3 次插入18 次删除
  1. 1 6
      net/ipv4/netfilter/arp_tables.c
  2. 1 6
      net/ipv4/netfilter/ip_tables.c
  3. 1 6
      net/ipv6/netfilter/ip6_tables.c

+ 1 - 6
net/ipv4/netfilter/arp_tables.c

@@ -49,12 +49,7 @@ MODULE_DESCRIPTION("arptables core");
 #endif
 #endif
 
 
 #ifdef CONFIG_NETFILTER_DEBUG
 #ifdef CONFIG_NETFILTER_DEBUG
-#define ARP_NF_ASSERT(x)					\
-do {								\
-	if (!(x))						\
-		printk("ARP_NF_ASSERT: %s:%s:%u\n",		\
-		       __func__, __FILE__, __LINE__);	\
-} while(0)
+#define ARP_NF_ASSERT(x)	WARN_ON(!(x))
 #else
 #else
 #define ARP_NF_ASSERT(x)
 #define ARP_NF_ASSERT(x)
 #endif
 #endif

+ 1 - 6
net/ipv4/netfilter/ip_tables.c

@@ -51,12 +51,7 @@ MODULE_DESCRIPTION("IPv4 packet filter");
 #endif
 #endif
 
 
 #ifdef CONFIG_NETFILTER_DEBUG
 #ifdef CONFIG_NETFILTER_DEBUG
-#define IP_NF_ASSERT(x)						\
-do {								\
-	if (!(x))						\
-		printk("IP_NF_ASSERT: %s:%s:%u\n",		\
-		       __func__, __FILE__, __LINE__);	\
-} while(0)
+#define IP_NF_ASSERT(x)		WARN_ON(!(x))
 #else
 #else
 #define IP_NF_ASSERT(x)
 #define IP_NF_ASSERT(x)
 #endif
 #endif

+ 1 - 6
net/ipv6/netfilter/ip6_tables.c

@@ -52,12 +52,7 @@ MODULE_DESCRIPTION("IPv6 packet filter");
 #endif
 #endif
 
 
 #ifdef CONFIG_NETFILTER_DEBUG
 #ifdef CONFIG_NETFILTER_DEBUG
-#define IP_NF_ASSERT(x)						\
-do {								\
-	if (!(x))						\
-		printk("IP_NF_ASSERT: %s:%s:%u\n",		\
-		       __func__, __FILE__, __LINE__);	\
-} while(0)
+#define IP_NF_ASSERT(x)	WARN_ON(!(x))
 #else
 #else
 #define IP_NF_ASSERT(x)
 #define IP_NF_ASSERT(x)
 #endif
 #endif