From: Patrick McHardy <kaber@trash.net>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Netfilter Developer Mailing List <netfilter-devel@vger.kernel.org>
Subject: Re: [NETFILTER]: Move extensions' arguments into compound structure (1/2)
Date: Sun, 05 Oct 2008 18:36:02 +0200 [thread overview]
Message-ID: <48E8ECF2.7050008@trash.net> (raw)
In-Reply-To: <alpine.LNX.1.10.0810051226410.21891@fbirervta.pbzchgretzou.qr>
Jan Engelhardt wrote:
> On Sunday 2008-10-05 12:26, Patrick McHardy wrote:
>>>
>>> Constructing the xt_match_param for example in ipt_do_table() instead
>>> of do_match() would mean that iff some extension trashed, say,
>>> par->in, then all future extensions would get that new value, which
>>> is of course not what we wanted.
>> It isn't what we want? Why does it change the global value then?
>
> For example, ebt_snat does this:
>
> bool ebt_snat_tg_check(table, e, target, data, hookmask)
> {
> if (hookmask & base_chain_bit && tmp == EBT_RETURN)
> return false;
> hookmask &= ~base_chain_bit;
> if (hookmask & yada)
> whatever;
> else
> foo;
> }
>
> hookmask was coiped to the function by use of the stack (the usual stuff),
> but with the argument consolidation, it now reads like:
>
> par->hookmask &= ~base_chain_bit;
>
> which means that the caller will see the altered hook mask. This is why
> the struct is thrown away everytime.
OK, so ebt_snat_tg_check has to use a local copy.
>>> Requesting verdict from you. :)
>>> Make it const so that extensions don't tamper with it?
>> Preferrably, yes.
>>
> Perfect.
Great.
next prev parent reply other threads:[~2008-10-05 16:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-03 22:52 [NETFILTER]: Move extensions' arguments into compound structure (1/2) Jan Engelhardt
2008-10-03 22:54 ` [NETFILTER]: Move extensions' arguments into compound structure (2/2) Jan Engelhardt
2008-10-04 13:48 ` [NETFILTER]: Move extensions' arguments into compound structure (1/2) Jan Engelhardt
2008-10-05 14:30 ` Patrick McHardy
2008-10-05 14:40 ` Jan Engelhardt
2008-10-05 14:52 ` Patrick McHardy
2008-10-05 14:55 ` Jan Engelhardt
2008-10-05 15:12 ` Patrick McHardy
2008-10-05 15:24 ` Jan Engelhardt
2008-10-05 15:31 ` Patrick McHardy
2008-10-05 16:19 ` Jan Engelhardt
2008-10-05 16:26 ` Patrick McHardy
2008-10-05 16:33 ` Jan Engelhardt
2008-10-05 16:36 ` Patrick McHardy [this message]
2008-10-05 20:14 ` Jan Engelhardt
2008-10-06 10:18 ` 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=48E8ECF2.7050008@trash.net \
--to=kaber@trash.net \
--cc=jengelh@medozas.de \
--cc=netfilter-devel@vger.kernel.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.