From: Massimiliano Hofer <max@nucleus.it>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: [PATCH 1/2][priv_data-condition][part 1/2][core]
Date: Tue, 5 Dec 2006 23:06:54 +0100 [thread overview]
Message-ID: <200612052306.57390.max@nucleus.it> (raw)
In-Reply-To: <451EA13B.5050700@trash.net>
On Saturday 30 September 2006 6:54 pm, Patrick McHardy wrote:
Sorry for the long delay. I've only been able to work on it in bursts.
I hope you're still interested.
> I wish you would have updated my patch instead. It had more logical
> argument ordering and a few other cleanups. It was also structured
> in a way that left the tree compiling at each step, so we don't
> make peoples life performing bisections unnecessarily hard.
I was already half throu when I received your patch.
In a few minutes I'll send a new series of patches that integrates you
suggestions both in code and in declarations.
I also separated my code in smaller and self contained patches.
Every step has been tested.
> > extern int xt_compat_target_to_user(struct xt_entry_target *t,
> > - void __user **dstptr, int *size);
> > + void * __user *dstptr, int *size);
>
> This reintroduces a bug that was fixed a few days ago.
Whops... It was merged by mistake. Corrected.
> > + ret = xt_init_target(t, "ipt", AF_INET,
> > + name, e->comefrom, e->ip.proto,
> > + e->ip.invflags & IPT_INV_PROTO);
>
> x_tables can deduce the prefix from the address family.
You're right. Done.
> > - if (m->u.kernel.match->checkentry
> > - && !m->u.kernel.match->checkentry(name, ip, match, dm->data,
> > - hookmask)) {
> > + if (m->u.kernel.match->init
> > + && !m->u.kernel.match->init(name, ip, match, dm->data,
> > + hookmask, m->u.kernel.priv_data)) {
>
> The ->checkentry/->init call should be performed in xt_init_match.
I was trying not to be too intrusive and I didn't like the idea that this
breaks the similarity between xt_init_target() and xt_init_matches().
Anyway I ended up changing a lot of things nontheless, so I might as well do
it. :)
Implemented in the incoming patches.
I refrained from doing the same code shifting between init_entry() and
xt_init_target() since it does a lot of similar, but protocol dependent
things. I'd like to analyze and test it separately.
> > + if (match->priv_size) {
> > + m->u.kernel.priv_data = kzalloc(match->priv_size,
> > + GFP_KERNEL);
> > + if (!m->u.kernel.priv_data) {
> > + printk("%s_tables: %s match: "
> > + "unable to allocate memory\n",
> > + xt_prefix[family], match->name);
> > + return -ENOMEM;
>
> It should clean up behind itself.
Now that it does the whole work, it cleans up as well. Done.
--
Saluti,
Massimiliano Hofer
Nucleus
next prev parent reply other threads:[~2006-12-05 22:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-24 22:40 [PATCH 0/2][priv_data-condition] Massimiliano Hofer
2006-09-25 8:15 ` Massimiliano Hofer
2006-09-25 8:16 ` [PATCH 1/2][priv_data-condition][part 1/2][core] Massimiliano Hofer
2006-09-30 16:54 ` Patrick McHardy
2006-12-05 22:06 ` Massimiliano Hofer [this message]
2006-09-25 8:17 ` [PATCH 1/2][priv_data-condition][part 2/2][matches_and_targets] Massimiliano Hofer
2006-09-30 16:55 ` Patrick McHardy
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=200612052306.57390.max@nucleus.it \
--to=max@nucleus.it \
--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.