IRC Zero Port Fix
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): 1106412163.7965.10.camel@debian
PATCH 1/1 IRC Zero Port Fix
Quoted 9 lines · Ian Kumlien
Hi,
I just noticed that the dcc helper doesn't work, it just sets the source ip to 0. And since i have no clue of that code, i choose not to dive in to it with no prior knowledge to structures and stuff.. I decided to ask you instead.
So is this known?
And you don't do anything to the size with the new code right?
Here's the fix, thanks for the bug report.
Rusty (who just learnt a lot about the IRC protocol).
Name: IRC Zero Port Fix
Status: Tested under nfsim, booted under qemu
Ian Kumlien reported that new NAT code started sending out DCC requests with 0 as the IP address. That prompted me to write a simple IRC test case, which both illustrated the bug, and found another one in that the wrong expectation was being set up when NAT occurred.
net/ipv4/netfilter/ip_nat_irc.c +4 -1
@@ -83,7 +83,10 @@* 0x01, \n: terminators */ -sprintf (buffer,"%u %u" ,ntohl (exp->tuple.src.ip), port); +/* AAA = "us", ie. where server normally talks to. */ +sprintf (buffer,"%u %u" , +ntohl (exp->master->tuplehash[IP_CT_DIR_REPLY ].tuple.dst.ip), + port);DEBUGP ("ip_nat_irc: Inserting '%s' == %u.%u.%u.%u, port %u\n" , buffer,NIPQUAD (exp->tuple.src.ip), port);
net/ipv4/netfilter/ip_conntrack_irc.c +6 -1
@@ -209,9 +209,14 @@DEBUGP ("tcph->seq = %u\n" , th->seq); seq =ntohl (th->seq) + (addr_beg_p - ib_ptr); +/* We refer to the reverse direction ("!dir") +* tuples here, because we're expecting +* something in the other * direction. +* Doesn't matter unless NAT is happening. */ exp->tuple = ((struct ip_conntrack_tuple ) { {0 , {0 } }, - { ct->tuplehash[dir].tuple.src.ip, { .tcp = {htons (dcc_port) } }, + { ct->tuplehash[!dir].tuple.dst.ip, + { .tcp = {htons (dcc_port) } },IPPROTO_TCP }}); exp->mask = ((struct ip_conntrack_tuple) { { 0, { 0 } },
Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman
Quoted 8 lines · On Tue, 25 Jan 2005 18:08:48 +1100 Rusty Russell <[email protected]> wrote:
Name: IRC Zero Port Fix
Status: Tested under nfsim, booted under qemuSigned-off-by Rusty Russell <[email protected]>Ian Kumlien reported that new NAT code started sending out DCC requests with 0 as the IP address. That prompted me to write a simple IRC test case, which both illustrated the bug, and found another one in that the wrong expectation was being set up when NAT occurred.
Applied, thanks Rusty.