From: Peter Parkkali <peter.parkkali@iki.fi>
To: netfilter-devel@lists.netfilter.org
Subject: Question + patch: FTP conntrack fails to recognize a PORT command
Date: 25 Nov 2003 20:02:32 +0200 [thread overview]
Message-ID: <1069783352.19640.104.camel@ferrari> (raw)
[-- Attachment #1: Type: text/plain, Size: 1161 bytes --]
Hi all,
I've found a case where an ftp PORT command is not recognized
by help() in ip_conntrack_ftp.c. This happens only with one
particular client, so there could be something wrong w/ the
client too. Anyway, in this case the address in the PORT command
is not rewritten but instead the 192.168.etc address is let through.
The bug can be avoided by commenting out the "return NF_ACCEPT;"
from line 298 (uhh... 2.4.22 source, not cvs, sorry). This allows
the rest of help() to find the "PORT" string, do NAT etc.
This works, but since I don't really understand the code, I thought
somebody could advice me on the sanity of this approach? ;) Is it safe
to bypass this check is could the actual bug be somewhere else?
The affected code (patch attached):
if(!old_seq_aft_nl_set ||
(ntohl(tcph->seq) != old_seq_aft_nl)) {
DEBUGP("ip_conntrack_ftp_help: wrong seq pos %s(%u)\n",
old_seq_aft_nl_set ? "":"(UNSET) ",
old_seq_aft_nl);
return NF_ACCEPT;
}
Thanks,
-peter
--
pp / pfp@iki.fi / peter.parkkali@profiz.com /
040-532 95 80 / +358-40-532 95 80
[-- Attachment #2: ftp_port_cmd.patch --]
[-- Type: text/plain, Size: 474 bytes --]
--- net/ipv4/netfilter/ip_conntrack_ftp.c 2003-11-25 19:47:15.000000000 +0200
+++ net/ipv4/netfilter/ip_conntrack_ftp.c.orig 2003-11-25 19:06:36.000000000 +0200
@@ -295,7 +295,7 @@
(ntohl(tcph->seq) != old_seq_aft_nl)) {
DEBUGP("ip_conntrack_ftp_help: wrong seq pos %s(%u)\n",
old_seq_aft_nl_set ? "":"(UNSET) ", old_seq_aft_nl);
- // return NF_ACCEPT;
+ return NF_ACCEPT;
}
/* Initialize IP array to expected address (it's not mentioned
next reply other threads:[~2003-11-25 18:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-25 18:02 Peter Parkkali [this message]
2003-11-29 18:44 ` Question + patch: FTP conntrack fails to recognize a PORT command Henrik Nordstrom
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1069783352.19640.104.camel@ferrari \
--to=peter.parkkali@iki.fi \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.