All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6 1/14]: Fix non-existant config option CONFIG_NF_DEBUG
@ 2004-06-21 19:38 Harald Welte
  2004-06-21 21:44 ` David S. Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Harald Welte @ 2004-06-21 19:38 UTC (permalink / raw)
  To: David Miller; +Cc: Netfilter Development Mailinglist


[-- Attachment #1.1: Type: text/plain, Size: 492 bytes --]

Hi Dave!

Sorry for the patch-bombing, but we have finally decided that now is the
right time to submit some long-standing fixes and additions to netfilter
in the 2.6.x series.

Please apply to your tree, thanks.


This patch for 2.6 fixes a non-existant config option (CONFIG_NF_DEBUG)
for IP_NF_ASSERT and fixes a couple of broken assertions.

Author: Patrick McHardy <kaber@trash.net>

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Harald Welte <laforge@netfilter.org>



[-- Attachment #1.2: 01.diff --]
[-- Type: text/plain, Size: 3288 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/06/20 22:25:24+02:00 kaber@trash.net 
#   [NETFILTER]: Fix non-existant config option for IP_NF_ASSERT, fix some broken assertions
# 
# net/ipv4/netfilter/ip_nat_core.c
#   2004/06/20 22:25:13+02:00 kaber@trash.net +3 -2
#   [NETFILTER]: Fix non-existant config option for IP_NF_ASSERT, fix some broken assertions
# 
# net/ipv4/netfilter/ip_conntrack_core.c
#   2004/06/20 22:25:13+02:00 kaber@trash.net +1 -3
#   [NETFILTER]: Fix non-existant config option for IP_NF_ASSERT, fix some broken assertions
# 
# include/linux/netfilter_ipv4/ip_conntrack.h
#   2004/06/20 22:25:13+02:00 kaber@trash.net +1 -1
#   [NETFILTER]: Fix non-existant config option for IP_NF_ASSERT, fix some broken assertions
# 
diff -Nru a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
--- a/include/linux/netfilter_ipv4/ip_conntrack.h	2004-06-20 22:59:21 +02:00
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h	2004-06-20 22:59:21 +02:00
@@ -103,7 +103,7 @@
 #include <linux/types.h>
 #include <linux/skbuff.h>
 
-#ifdef CONFIG_NF_DEBUG
+#ifdef CONFIG_NETFILTER_DEBUG
 #define IP_NF_ASSERT(x)							\
 do {									\
 	if (!(x))							\
diff -Nru a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c
--- a/net/ipv4/netfilter/ip_conntrack_core.c	2004-06-20 22:59:21 +02:00
+++ b/net/ipv4/netfilter/ip_conntrack_core.c	2004-06-20 22:59:21 +02:00
@@ -173,13 +173,12 @@
 destroy_expect(struct ip_conntrack_expect *exp)
 {
 	DEBUGP("destroy_expect(%p) use=%d\n", exp, atomic_read(&exp->use));
-	IP_NF_ASSERT(atomic_read(&exp->use));
+	IP_NF_ASSERT(atomic_read(&exp->use) == 0);
 	IP_NF_ASSERT(!timer_pending(&exp->timeout));
 
 	kfree(exp);
 }
 
-
 inline void ip_conntrack_expect_put(struct ip_conntrack_expect *exp)
 {
 	IP_NF_ASSERT(exp);
@@ -715,7 +714,6 @@
 		DEBUGP("conntrack: expectation arrives ct=%p exp=%p\n",
 			conntrack, expected);
 		/* Welcome, Mr. Bond.  We've been expecting you... */
-		IP_NF_ASSERT(master_ct(conntrack));
 		__set_bit(IPS_EXPECTED_BIT, &conntrack->status);
 		conntrack->master = expected;
 		expected->sibling = conntrack;
diff -Nru a/net/ipv4/netfilter/ip_nat_core.c b/net/ipv4/netfilter/ip_nat_core.c
--- a/net/ipv4/netfilter/ip_nat_core.c	2004-06-20 22:59:21 +02:00
+++ b/net/ipv4/netfilter/ip_nat_core.c	2004-06-20 22:59:21 +02:00
@@ -528,6 +528,7 @@
 	MUST_BE_WRITE_LOCKED(&ip_nat_lock);
 	IP_NF_ASSERT(hooknum == NF_IP_PRE_ROUTING
 		     || hooknum == NF_IP_POST_ROUTING
+		     || hooknum == NF_IP_LOCAL_IN
 		     || hooknum == NF_IP_LOCAL_OUT);
 	IP_NF_ASSERT(info->num_manips < IP_NAT_MAX_MANIPS);
 	IP_NF_ASSERT(!(info->initialized & (1 << HOOK2MANIP(hooknum))));
@@ -899,10 +900,10 @@
 
 	/* Must be RELATED */
 	IP_NF_ASSERT((*pskb)->nfct
-		     - (struct ip_conntrack *)(*pskb)->nfct->master
+		     - ((struct ip_conntrack *)(*pskb)->nfct->master)->infos
 		     == IP_CT_RELATED
 		     || (*pskb)->nfct
-		     - (struct ip_conntrack *)(*pskb)->nfct->master
+		     - ((struct ip_conntrack *)(*pskb)->nfct->master)->infos
 		     == IP_CT_RELATED+IP_CT_IS_REPLY);
 
 	/* Redirects on non-null nats must be dropped, else they'll


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-06-21 23:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-21 19:38 [PATCH 2.6 1/14]: Fix non-existant config option CONFIG_NF_DEBUG Harald Welte
2004-06-21 21:44 ` David S. Miller
2004-06-21 22:44   ` Harald Welte
2004-06-21 23:01     ` David S. Miller
2004-06-21 23:20       ` Patrick McHardy
2004-06-21 23:27         ` David S. Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.