All of lore.kernel.org
 help / color / mirror / Atom feed
From: Massimiliano Hofer <max@nucleus.it>
To: netfilter-devel@lists.netfilter.org
Cc: Patrick McHardy <kaber@trash.net>, KOVACS Krisztian <hidden@balabit.hu>
Subject: Re: condition for 2.6.16
Date: Sat, 29 Apr 2006 17:36:25 +0200	[thread overview]
Message-ID: <200604291736.27030.max@nucleus.it> (raw)
In-Reply-To: <4452D5C8.6020007@trash.net>

On Saturday 29 April 2006 4:56 am, Patrick McHardy wrote:
> > Nontheless, I think modifying userspace because 2 kernel functions can't
> > talk to each other is a bit silly.
> > It would be relatively easy to modify the kernel in order to support
> > instance data (extensive, but simple and relatively safe).
> > Do you think there would be a strong resistance to a patch in mainline
> > kernel?
>
> It is silly, but we have to live with it. I see two possibilities, one
> breaks userspace, one is extremly expensive. I like neither one.
> We should just add a clean netlink configuration interface modelled
> after the existing ones instead of building workarounds in this
> clearly broken interface. I mostly don't care about costs of a
> compatibility layer if we get a sane infrastructure in return.

I agree about the 2 non invasive (with respect to the mainline kernel) 
solutions.

If I could choose freely I would change these structures (and all 
corresponding references and initialization code) as follows:



struct xt_match
{
...
        int (*match)(const struct sk_buff *skb,
                     const struct net_device *in,
                     const struct net_device *out,
                     const void *matchinfo,
                     int offset,
                     unsigned int protoff,
                     int *hotdrop,
                     void *instance_data);

        int (*checkentry)(const char *tablename,
                          const void *ip,
                          void *matchinfo,
                          unsigned int matchinfosize,
                          unsigned int hook_mask,
                          void **instance_data);

        void (*destroy)(void *matchinfo,
                        unsigned int matchinfosize,
                        void *instance_data);
...
};


struct ipt_entry_match
{
...
	void *instance_data;
        unsigned char data[0];
};


This would solve the general problem of rule specific data (tracking, state, 
accounting, whatever).
It gives more expressiveness to the API in general and would have little 
impact on the parts of the code that do not use it (instance_data is 
initialized as NULL and never used).
The performance penalty would be negligible (4 or 8 more bytes in every 
descriptor and in every function call to the match function).

We could minimize impact on the existing code introducing a "normal" and an 
"extended" match funciton prototype, but this would crete complexity and its 
only purpose is if we don't want to upgrade everything.

The problem with my solution is:
- it's work (I could do it, so it's not your problem :));
- the kernel people may reject it or delay it for an extended period of time;
- while we the patch is available and the kernel people does not accept it 
we'll be stuck with 2 sets of incompatible netfilter APIs with all kinds of 
inconveniences while everyone updates their function declarations (we already 
survived one such change with 2.6.16).

I ask you these questions:
- is my proposal a desirable improvement?
- is there any other way or any additional improvement that we can do?
- would you support it for inclusion in mainline?
- would the kernel people like it?

If you think this is worth the trouble and promise to support the patch  for 
inclusion in mainline (at least after we agree to the implemetation details) 
I will start working on it.

-- 
Saluti,
   Massimiliano Hofer
        Nucleus

  reply	other threads:[~2006-04-29 15:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-20 17:19 condition for 2.6.16 Massimiliano Hofer
2006-04-20 18:49 ` Patrick McHardy
2006-04-20 19:39   ` Massimiliano Hofer
2006-04-20 19:44     ` Martijn Lievaart
2006-04-20 22:47     ` Patrick McHardy
2006-04-20 23:26       ` Massimiliano Hofer
2006-04-21  0:41         ` Gerd v. Egidy
2006-04-21  0:48         ` Gerd v. Egidy
2006-04-21  9:29           ` Amin Azez
2006-04-23 13:47   ` Simon Lodal
2006-04-28  7:12     ` Patrick McHardy
2006-04-28 10:46       ` Massimiliano Hofer
2006-04-28 11:06         ` Patrick McHardy
2006-04-28 12:44           ` Massimiliano Hofer
2006-04-28 12:58             ` Jozsef Kadlecsik
2006-04-28 13:07               ` Patrick McHardy
2006-04-28 15:18                 ` KOVACS Krisztian
2006-04-28 15:34                   ` Patrick McHardy
2006-04-29  0:53                     ` Massimiliano Hofer
2006-04-29  2:56                       ` Patrick McHardy
2006-04-29 15:36                         ` Massimiliano Hofer [this message]
2006-04-28 13:18               ` Massimiliano Hofer
2006-04-28 13:09             ` Patrick McHardy
2006-04-28 13:26               ` Massimiliano Hofer

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=200604291736.27030.max@nucleus.it \
    --to=max@nucleus.it \
    --cc=hidden@balabit.hu \
    --cc=kaber@trash.net \
    --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.