Skip to contentSkip to conversation

ip_conntrack_irc update

PATCH Applied Harald Welte 2 participants 2 messages Oct 2, 2003 – Oct 3, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ip_conntrack_irc update

Hi Davem!

Please apply the following patch to your 2.4 tree and push it to Marcelo. Thanks.

Author: Tiago Sousa <[email protected]>
Status: pending for kernel inclusion

Add support for mIRC's "server lookup" DCC address detection to ip_conntrack_irc.c

Signature · 5 lines
- 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
net/ipv4/netfilter/ip_conntrack_irc.c renamed from net/ipv4/netfilter/ip_conntrack_irc.c.orig +5 -2
@@ -192,7 +192,10 @@
 			DEBUGP("DCC bound ip/port: %u.%u.%u.%u:%u\n",
 				HIPQUAD(dcc_ip), dcc_port);
 
-			if (ct->tuplehash[dir].tuple.src.ip != htonl(dcc_ip)) {
+			/* dcc_ip can be the internal OR external (NAT'ed) IP
+			 * Tiago Sousa <[email protected]> */
+			if (ct->tuplehash[dir].tuple.src.ip != htonl(dcc_ip)
+			    && ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip != htonl(dcc_ip)) {
 				if (net_ratelimit())
 					printk(KERN_WARNING
 						"Forged DCC command from "
@@ -218,7 +218,7 @@
 
 			exp->tuple = ((struct ip_conntrack_tuple)
 				{ { 0, { 0 } },
-				  { htonl(dcc_ip), { .tcp = { htons(dcc_port) } },
+				  { ct->tuplehash[dir].tuple.src.ip, { .tcp = { htons(dcc_port) } },
 				    IPPROTO_TCP }});
 			exp->mask = ((struct ip_conntrack_tuple)
 				{ { 0, { 0 } },
#1 lore raw
Quoted 1 line · On Thu, 2 Oct 2003 16:45:26 +0200 Harald Welte <[email protected]> wrote:

Please apply the following patch to your 2.4 tree and push it to Marcelo.

Applied, thanks.