: Fix non-existant config option CONFIG_NF_DEBUG
Subsystems (2)
PATCH 1/10 : Fix non-existant config option CONFIG_NF_DEBUG
Hi Dave!
This is part 1 of a 10 patch set that adds all fixes (no new features) to 2.4.x kernel and thus syncs with the recent patchset for 2.6.x.
None of them fixes important or even security relevant issues, so all can be post 2.4.27.
Please apply to your tree and push to Marcelo, thanks.
This patch for 2.4 fixes a non-existant config option (CONFIG_NF_DEBUG) for IP_NF_ASSERT and fixes a couple of broken assertions.
Author: Patrick McHardy <[email protected]>
--
- Harald Welte <[email protected]> http://www.netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie
# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/06/20 22:26:18+02:00 [email protected]
# [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:26:15+02:00 [email protected] +5 -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:26:15+02:00 [email protected] +2 -5 # [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:26:15+02:00 [email protected] +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 23:02:33 +02:00 +++ b/include/linux/netfilter_ipv4/ip_conntrack.h 2004-06-20 23:02:33 +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)) \
net/ipv4/netfilter/ip_conntrack_core.c +2 -5
@@ -175,13 +175,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);
@@ -504,7 +503,7 @@ enum ip_conntrack_info *ctinfo, unsigned int hooknum) { -const struct iphdr *iph; +const struct iphdr *iph = skb->nh.iph;struct icmphdr *hdr;struct ip_conntrack_tuple innertuple, origtuple;struct iphdr *inner;
@@ -515,7 +514,6 @@IP_NF_ASSERT (iph->protocol ==IPPROTO_ICMP );IP_NF_ASSERT (skb->nfct ==NULL ); - iph = skb->nh.iph; hdr = (struct icmphdr *)((u_int32_t *)iph + iph->ihl); inner = (struct iphdr *)(hdr +1 ); datalen = skb->len - iph->ihl*4 -sizeof (*hdr);
@@ -731,7 +729,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;
net/ipv4/netfilter/ip_nat_core.c +5 -2
@@ -520,6 +520,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))));
@@ -882,9 +883,11 @@IP_NF_ASSERT (skb->len >= iph->ihl*4 +sizeof (struct icmphdr ));/* Must be RELATED */ -IP_NF_ASSERT (skb->nfct - (struct ip_conntrack *)skb->nfct->master +IP_NF_ASSERT (skb->nfct + - ((struct ip_conntrack *)skb->nfct->master)->infos ==IP_CT_RELATED - || skb->nfct - (struct ip_conntrack *)skb->nfct->master + || skb->nfct + - ((struct ip_conntrack *)skb->nfct->master)->infos ==IP_CT_RELATED +IP_CT_IS_REPLY );/* Redirects on non-null nats must be dropped, else they'll
Quoted 7 lines · On Mon, 21 Jun 2004 21:50:10 +0200 Harald Welte <[email protected]> wrote:
This is part 1 of a 10 patch set that adds all fixes (no new features) to 2.4.x kernel and thus syncs with the recent patchset for 2.6.x.
None of them fixes important or even security relevant issues, so all can be post 2.4.27.
Please apply to your tree and push to Marcelo, thanks.
All 2.4.x patches applied, thanks.