From: Martin Josefsson <gandalf@wlug.westbo.se>
To: Harald Welte <laforge@netfilter.org>
Cc: netfilter-devel@lists.netfilter.org, pablo@eurodev.net, kaber@trash.net
Subject: Re: [PATCH 1/2] string match for iptables
Date: Thu, 25 Aug 2005 19:19:15 +0200 [thread overview]
Message-ID: <1124990355.28166.31.camel@localhost.localdomain> (raw)
In-Reply-To: <1124988859.28166.28.camel@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 2844 bytes --]
On Thu, 2005-08-25 at 18:54 +0200, Martin Josefsson wrote:
I wonder why davem got lost on the CC, he's there in my Sent folder but
not in the mail I got from netfilter-devel... I hope he makes it this
time.
> On Thu, 2005-08-25 at 12:42 +0200, Harald Welte wrote:
>
> > > One thing that can help is to not put pointers into these rules,
> > > that is actually the most difficult case to handle. Without
> > > pointers, the entire struct can be defined using portable types
> > > that require no translation. Once you introduce a pointer, using
> > > the user's struct as-is becomes impossible. (as an added bonus
> > > such rules could thus be sent over the wire as well, if we ever
> > > wanted to do that)
> >
> > The only reason why a pointer is needed at all, is the "dump whole table
> > to userspace, do some modifications and read it back" approach. I
> > seriously doubt that we would be able to change that assumption. If we
> > did, it wouldn't be iptables anymore, but half-way into pkttables.
> >
> > As an intermediate solution we could do some form of indirect
> > resolval/mapping. The core could provide an allocation wrapper API
> > which matches/targets could use for malloc'ing their private data
> > structures. In addition to a pointer, it would return an (32bit) ID.
> > That ID can then be embedded in kernel/userspace data structures. When
> > userspace rules come in, the ID gets translated to the real pointer by
> > some call to that API of the core.
>
> Now that we have support for diffrent revisions of matches/targets we
> can easily add new revisions that uses diffrent structs and later
> deprecate the older revisions.
>
> Matches and targets have two sizes defined for their datastructures,
> size and userspacesize. size is the total size of the datastructure, the
> amount that is allocated for the rule private data. And userspacesize is
> the amount transferred to/from userspace when rules are modified.
>
> So we could put all portable members at the top of the structure and all
> pointers at the end and set userspacesize to the offset of the first
> pointer in the structure. There's no need to transfer that data back and
> forth to userspace, it just introduces races in the cases where there's
> members used for refcounting in the structure.
> So the remaining problem is that the total size of the structure is
> diffrent on 32/64 bit.
> The userspacesize stays the same on both but not the part of the
> structure that holds the "kernelprivate data", iow the last part of the
> structure, that changes on 32/64bit and I don't think we can assume that
> the size on 64bit is 2 * size on 32bit, that only holds for non portable
> types, what if someone wants a portable size in this section...
>
> Any ideas?
>
--
/Martin
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-08-25 17:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-20 16:06 [PATCH 1/2] string match for iptables Pablo Neira
2005-08-20 16:35 ` Patrick McHardy
2005-08-20 20:14 ` David S. Miller
2005-08-21 13:55 ` Patrick McHardy
2005-08-21 22:34 ` David S. Miller
2005-08-22 0:13 ` Patrick McHardy
2005-08-22 2:14 ` David S. Miller
2005-08-25 10:42 ` Harald Welte
2005-08-25 16:54 ` Martin Josefsson
2005-08-25 17:19 ` Martin Josefsson [this message]
2005-08-26 12:00 ` Patrick McHardy
2005-08-26 13:27 ` DaveM get's removed from Cc (was Re: [PATCH 1/2] string match for iptables) Harald Welte
2005-08-26 15:21 ` Phil Oester
2005-08-26 18:33 ` Harald Welte
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=1124990355.28166.31.camel@localhost.localdomain \
--to=gandalf@wlug.westbo.se \
--cc=kaber@trash.net \
--cc=laforge@netfilter.org \
--cc=netfilter-devel@lists.netfilter.org \
--cc=pablo@eurodev.net \
/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.