From: Thomas Egerer <thomas.Egerer@secunet.com>
To: linux-kernel@vger.kernel.org
Subject: ip_rt_bug weirdness
Date: Wed, 12 Dec 2007 13:49:36 +0100 [thread overview]
Message-ID: <475FD8E0.5030009@secunet.com> (raw)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
Hello *,
maybe it's my bad. Most probably! Even in that case I'd need someone to
point out the mistake to me!
I'm currently (trying) to write a transparent proxy application, using
libipq to capture packets + iptables' redirect mechanism.
The basic idea works as follows:
+---+ +---+ +---+
| S |<---->| P |<---->| D |
+---+ (1) +---+ (2) +---+
(1) uses iptables' REDIRECT target; the received data is then forwarded,
using another socket connection (2)
(2) uses libipq to do some kind of SNAT and change the local source
address to S's address and vice versa for the incoming packets
from D
So far the theory. The application works fine, as long, as I do not
remap the source port (destination port, respectively) from P to D. Once
I enable the port remapping I get syslog messages like the following:
[ 7742.939471] ip_rt_bug: [S' IP] -> [P's IP at (2)], ?
and a reset from P towards D, using exactly all the correct TCP
settings, except for the destination port, that is 1, sometimes 2, or 3.
I couldn't figure out, why.
By the way, the three-way-handshake works fine, the RSTs are generated
for the first packet to contain a TCP-payload. Also netstat tells me,
there is an established connection between P and D, but somehow (I
assume that this might be the trouble) looking for the corresponding
socket connection on P fails.
I'm totally puzzled why that happens. libipq reinjects the packets with
properly changed checksums and whatnot, yet the RSTs are generated.
I've also tried NF_REPEAT, instead of the NF_ACCEPT verdict. The
behavior remains identically.
Any ideas, anyone?
Thanks in advance
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHX9jgUGqFG0l5Kr0RAyKTAJ9qempDK//O0TrCwXgXzpdjBhW+QwCeJnUQ
udz08rqnHoFvkFF6q7a2C2s=
=DZhp
-----END PGP SIGNATURE-----
reply other threads:[~2007-12-12 13:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=475FD8E0.5030009@secunet.com \
--to=thomas.egerer@secunet.com \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox