Skip to contentSkip to conversation

: Fix two broken assertions

PATCH In review Patrick McHardy 1 participant 1 message Sep 21, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 10/12 : Fix two broken assertions

[email protected], 2004-09-20 11:52:16+02:00, [email protected]
[NETFILTER]: Fix two broken assertions

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/09/20 11:52:16+02:00 [email protected]
# [NETFILTER]: Fix two broken assertions
#
# Signed-off-by: Patrick McHardy <[email protected]>
#

# net/ipv4/netfilter/ip_nat_core.c
#   2004/09/20 11:51:56+02:00 [email protected] +2 -6
#   [NETFILTER]: Fix two broken assertions
#   
#   Signed-off-by: Patrick McHardy <[email protected]>
# 
# net/ipv4/netfilter/ip_conntrack_core.c
#   2004/09/20 11:51:56+02:00 [email protected] +1 -1
#   [NETFILTER]: Fix two broken assertions
#   
#   Signed-off-by: Patrick McHardy <[email protected]>
# 
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-09-20 11:59:17 +02:00
+++ b/net/ipv4/netfilter/ip_conntrack_core.c	2004-09-20 11:59:17 +02:00
@@ -590,7 +590,7 @@
 		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));
+		IP_NF_ASSERT(expected->expectant);
 		__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-09-20 11:59:17 +02:00
+++ b/net/ipv4/netfilter/ip_nat_core.c	2004-09-20 11:59:17 +02:00
@@ -852,12 +852,8 @@
 	}

/* Must be RELATED */
- IP_NF_ASSERT((*pskb)->nfct

-		     - ((struct ip_conntrack *)(*pskb)->nfct->master)->infos
-		     == IP_CT_RELATED
-		     || (*pskb)->nfct
-		     - ((struct ip_conntrack *)(*pskb)->nfct->master)->infos
-		     == IP_CT_RELATED+IP_CT_IS_REPLY);

+ IP_NF_ASSERT((*pskb)->nfctinfo == IP_CT_RELATED ||
+ (*pskb)->nfctinfo == IP_CT_RELATED+IP_CT_IS_REPLY);

/* Redirects on non-null nats must be dropped, else they'll
start talking to each other without our translation, and be