[PATCH] eggdrop-conntrack

Magnus Sandin magnus@sandin.cx
Mon, 28 Jan 2002 21:50:54 +0100


This is a multi-part message in MIME format.
--------------090002090704000907010906
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi!

Applied patch for the patch-o-matic eggdrop connection tracking patch, 
fixes some connection tracking problems with eggdrop bots version 1.6.x...

Regards
// Magnus


--------------090002090704000907010906
Content-Type: text/plain;
 name="eggdrop-conntrack.patch.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="eggdrop-conntrack.patch.patch"

diff -Nru netfilter-20020126/userspace/patch-o-matic/extra/eggdrop-conntrack.patch netfilter/userspace/patch-o-matic/extra/eggdrop-conntrack.patch
--- netfilter-20020126/userspace/patch-o-matic/extra/eggdrop-conntrack.patch	Mon Nov 12 09:19:29 2001
+++ netfilter/userspace/patch-o-matic/extra/eggdrop-conntrack.patch	Mon Jan 28 21:38:13 2002
@@ -1,8 +1,8 @@
-diff -Nru linux/net/ipv4/netfilter/ip_conntrack_egg.c linux-fix/net/ipv4/netfilter/ip_conntrack_egg.c
---- linux/net/ipv4/netfilter/ip_conntrack_egg.c	Thu Jan  1 01:00:00 1970
-+++ linux-fix/net/ipv4/netfilter/ip_conntrack_egg.c	Thu Apr 19 10:02:37 2001
-@@ -0,0 +1,225 @@
-+/* Eggdrop extension for IP connection tracking, Version 0.0.2
+diff -Nru linux-not-patched/net/ipv4/netfilter/ip_conntrack_egg.c linux/net/ipv4/netfilter/ip_conntrack_egg.c
+--- linux-not-patched/net/ipv4/netfilter/ip_conntrack_egg.c	Thu Jan  1 01:00:00 1970
++++ linux/net/ipv4/netfilter/ip_conntrack_egg.c	Mon Jan 28 21:35:10 2002
+@@ -0,0 +1,228 @@
++/* Eggdrop extension for IP connection tracking, Version 0.0.3
 + * based on ip_conntrack_irc.c	
 + *
 + *      This module only supports the share userfile-send command,
@@ -62,7 +62,6 @@
 +   ip		returns parsed ip of dcc command
 +   port		returns parsed port of dcc command */
 +{
-+
 +	if (data > data_end)
 +		return -1;
 +	
@@ -73,7 +72,6 @@
 +		data++;
 +
 +	*port = simple_strtoul(data, &data, 10);
-+
 +	return 0;
 +}
 +
@@ -89,6 +87,7 @@
 +	u_int32_t tcplen = len - iph->ihl * 4;
 +	u_int32_t datalen = tcplen - tcph->doff * 4;
 +	int dir = CTINFO2DIR(ctinfo);
++	int bytes_scanned = 0;
 +	struct ip_conntrack_tuple t, mask;
 +
 +	u_int32_t egg_ip;
@@ -128,13 +127,16 @@
 +	}
 +
 +	data_limit = (char *) data + datalen;
-+	if (datalen > 5) {
++	while (datalen > 5 && bytes_scanned < 128) {
 +		if (memcmp(data, "s us ", 5)) {
-+			return NF_ACCEPT;;
++			data++;
++			datalen--;
++			bytes_scanned++;
++			continue;
 +		}
 +
 +		data += 5;
-+	  
++
 +		DEBUGP ("ip_ct_egg: Userfile-share found in connection %u.%u.%u.%u %u.%u.%u.%u\n",
 +			NIPQUAD(iph->saddr),
 +			NIPQUAD(iph->daddr));
@@ -161,7 +163,7 @@
 +				       HIPQUAD(egg_ip), egg_port);
 +			return NF_ACCEPT;
 +		}
-+	  
++
 +		DEBUGP ("ip_ct_egg: expect_related %u.%u.%u.%u:%u - %u.%u.%u.%u:%u\n",
 +			NIPQUAD(t.src.ip),
 +			ntohs(t.src.u.tcp.port),
@@ -171,6 +173,7 @@
 +		ip_conntrack_expect_related(ct, &t,
 +					    &mask,
 +					    NULL);
++		break;
 +	}
 +	return NF_ACCEPT;
 +}
diff -Nru netfilter-20020126/userspace/patch-o-matic/extra/eggdrop-conntrack.patch.help netfilter/userspace/patch-o-matic/extra/eggdrop-conntrack.patch.help
--- netfilter-20020126/userspace/patch-o-matic/extra/eggdrop-conntrack.patch.help	Tue Dec 19 17:27:51 2000
+++ netfilter/userspace/patch-o-matic/extra/eggdrop-conntrack.patch.help	Mon Jan 28 21:26:26 2002
@@ -3,3 +3,4 @@
 
 This adds CONFIG_IP_NF_EGG:
 Connection tracking for eggdrop bot networks.
+It now also supports eggdrop v1.6.x

--------------090002090704000907010906--