All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Riechmann <riechmann@fgan.de>
To: Henrik Nordstrom <hno@marasystems.com>
Cc: netfilter-devel@lists.netfilter.org, bus@fgan.de
Subject: Re: Change proposal for consistent "skb->pkt_type" after re-injection
Date: Wed, 30 Jun 2004 21:30:25 +0200	[thread overview]
Message-ID: <20040630193025.GC1520@rie.rie.priv> (raw)
In-Reply-To: <Pine.LNX.4.44.0406301239040.3767-100000@filer.marasystems.com>

HenriK,

thanks for your reply. Some comments inline...

On 2004-06-30 12:43:50 +0200, Henrik Nordstrom wrote:
> On Tue, 29 Jun 2004, Christian Riechmann wrote:
> 
> > Apparantly the skb->pkt_type is set very early within one of the
> > kernel IP routines passed by the broadcasted or multicasted packet
> > BEFORE iptables gave it to the user space program and the
> > modified (now TCP packet with a host address) packet is re-injected
> > into the kernel processing.
> 
> Correct, and ip_queue does not have an option to let the userspace return 
> a new packet type. But there is other iptables modules allowing you to do 
> this kind of thing either before or after the packet is sent to ip_queue.

Maybe you can give me a pointer which are these modules.

> 
> > One - bad - solution for this problem could be to delete the above
> > test within the TCP functions, but this would produce difficulties,
> > if some people (hacker?) would send IP/TCP packets with multicast or
> > broadcast addresses.
> 
> Deleting these tests from TCP would cause serious problems. These tests 
> exists there for good reasons.

This is exactly what I meant with "bad" solution.

> 
> > As a better solution I would propose, that the processing initiated
> > by ipq_set_verdict should update the packet type (skb->pkt_type)
> > according to the re-injected packet.
> 
> How would it know? The packet type is dictated by how the packet arrived 
> to the box, not the IP content.

You are right, but if it is possible to re-inject another-type-packet, then
the skp->pkt_type should be updated FOR CONSISTENCY. The decision can
easily be done in the same way as it is done, when the packet enters the box:
By testing the address type of th re-injected packet, which by definition
is an IP packet.

> 
> 
> But honestly I would recommend reinjecting the packets via a TUN device.  
> This way a whole can of problems is avioded with very little complexity. I
> would even get the encapsulated packets out of the kernel via the same TUN
> device and just use iptables to have them routed there but that it me.

My understanding of TUN is that it offers only 1_to_1 and not 1_to_n
connections which I do need (IP/TCP packets have to be encapsulated within
UDP packets, which are broadcasted to the neighbor hosts). That is why I
did not yet overtake this proposal you made some weeks ago.

Regards
Christian
-- 
Christian Riechmann    E-Mail: riechmann@fgan.de
c/o FGAN/FKIE          Tel: (+49) 228/9435 345,378
Neuenahrer Strasse 20  Fax: (+49) 228/9435 685
D-53343 Wachtberg, Germany

  reply	other threads:[~2004-06-30 19:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-29  9:48 Change proposal for consistent "skb->pkt_type" after re-injection Christian Riechmann
2004-06-30 10:43 ` Henrik Nordstrom
2004-06-30 19:30   ` Christian Riechmann [this message]
2004-06-30 19:53     ` Henrik Nordstrom
2004-07-05 19:34       ` Christian Riechmann
2004-07-05 20:56         ` 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=20040630193025.GC1520@rie.rie.priv \
    --to=riechmann@fgan.de \
    --cc=bus@fgan.de \
    --cc=hno@marasystems.com \
    --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.