From: "Gaurav Aggarwal" <grv.aggarwal@gmail.com>
To: kernelnewbies@nl.linux.org, netfilter-devel@lists.netfilter.org
Cc: "Gaurav Aggarwal" <grv.aggarwal@gmail.com>
Subject: Packet drop during re-routing via netfilters
Date: Thu, 13 Sep 2007 18:54:15 +0530 [thread overview]
Message-ID: <1a41e0840709130624q436c5d03mb34ecdd5b91b60a3@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1799 bytes --]
Hi,
I'm using ip_tables and ip_queue modules to trap the packets from IP stack
to a userspace VPN product, using nothing but standard kernel modules (and
my own VPN proxy app). The packets flowing into or out of the machine get
diverted to a userspace application (actually a VPN client), where src/dest
addresses are modified if needed, and then injected back into the local IP
stack.
For example, an outgoing packet (that has a foreign dest addr) is overridden
with a local dest address, hoping it would end up at the local VPN listener.
Under kernel 2.4(checked on 2.4.20) this works fine.
In 2.6 it doesn't.
To me its seems that while traversing packets through Netfilter, changing
dest address from a foreign to a local address causes the packet to drop
(and show up at ip_rt_bug(), along a syslog entry in kernel 2.6..
* Details:
An outgoing packet (has a non-local dest addr) is queued and recognized at
the ip_queue userspace app. Its dest addr+port are set to that of the local
machine (to get to my userspace VPN app).
The modified packet is marked NF_ACCEPT and sent back into the kernel, but
ends up at the ip_rt_bug function (with a syslog entry).
* Assumed bug analysis:
Due to the destination address change, the packet needed to go through
routing once again, since it's no longer an outgoing packet.
I would have expected the routing function to realize it needs to
re-evaluate the route, and set the *okfn to dst->input instead of ip_rt_bug.
* Kernel version where problem found:
2.6.14 compiled locally with no modifications.
Please advise/suggest me what alternative I have now.
A similar problem has been reported a while back but never replied (
http://groups-beta.google.com/group/linux.kernel/msg/455c04e17e354d04?dmode=source&hl=en
)
--
Regards,
Gaurav Aggarwal
[-- Attachment #2: Type: text/html, Size: 2045 bytes --]
reply other threads:[~2007-09-13 13:24 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=1a41e0840709130624q436c5d03mb34ecdd5b91b60a3@mail.gmail.com \
--to=grv.aggarwal@gmail.com \
--cc=kernelnewbies@nl.linux.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).