mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re-routing packets via netfilter (ip_rt_bug)
@ 2005-04-25  9:49 Yair Itzhaki
  2005-04-25  9:07 ` Patrick McHardy
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Yair Itzhaki @ 2005-04-25  9:49 UTC (permalink / raw)
  To: linux-kernel

* Summary:
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).

* Description:
I'm using libipq/ip_tables and ip_queue to trap packets 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, src/dest addresses are modified, and injected back into the 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 this works fine.
In 2.6 it breaks. 

* 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.
This does happen in the ip_route_me_harder function, which sets the dst->output to point at ip_rt_bug.
Since this was an outgoing packet (in the NF_IP_LOCAL_OUT chain), the final operation done on the packet is calling the *okfn function, which points to dst->output which is ip_rt_bug.

I would have expected the routing function to realize it needs to re-evaluate the route, and set the *okfn to dst->input instead.

* Kernel version:
2.6.9-prep, (Red Hat 3.4.2-6.fc3) compiled locally with no modifications.

Please advise (and please CC "YAIR at ARX.COM")

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)


Yair

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-07-23  7:31 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-25  9:49 Re-routing packets via netfilter (ip_rt_bug) Yair Itzhaki
2005-04-25  9:07 ` Patrick McHardy
2005-04-25 10:52   ` Herbert Xu
2005-04-25 15:28     ` Patrick McHardy
2005-04-25 21:34       ` Herbert Xu
2005-04-26  0:08         ` Patrick McHardy
2005-04-26  0:39           ` Herbert Xu
2005-04-26 13:17             ` Patrick McHardy
2005-04-26 23:28               ` Herbert Xu
2005-04-27  0:56                 ` Patrick McHardy
2005-04-27  1:07                   ` Herbert Xu
2005-04-27 10:26                     ` Patrick McHardy
2005-04-27 10:30                       ` Herbert Xu
2005-04-27 10:41                         ` Jozsef Kadlecsik
2005-04-27 11:35                           ` Herbert Xu
2005-04-27 11:54                             ` Herbert Xu
2005-04-27 12:05                               ` Patrick McHardy
2017-07-10  9:20 ` Helbing63
2020-07-23  7:25 ` technical support jollyzula
2020-07-23  7:25 ` Canon.com/ijsetup jollyzula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome