netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Netfilter Development Mailing list
	<netfilter-devel@vger.kernel.org>,
	Giuseppe Longo <giuseppelng@gmail.com>
Subject: Re: [ebtables-compat-experimental5 PATCH] iptables: xtables-eb: user-defined chains default policy is always RETURN
Date: Mon, 24 Nov 2014 10:46:57 +0100	[thread overview]
Message-ID: <CAOkSjBgr8UicdN80fvtMjiASWC-AWZUr-EG4MuaQqs3VvH34iQ@mail.gmail.com> (raw)
In-Reply-To: <20141120120718.GA9745@salvia>

On 20 November 2014 at 13:07, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
>> @@ -1146,9 +1147,17 @@ check_extension: */
>>       cs.fw.ethproto = htons(cs.fw.ethproto);
>>
>>       if (command == 'P') {
>> -             if (selected_chain < NF_BR_NUMHOOKS && strcmp(policy, "RETURN")==0)
>> +             if (selected_chain < 0) {
>>                       xtables_error(PARAMETER_PROBLEM,
>> -                                   "Policy RETURN only allowed for user defined chains");
>> +                                   "Default policy in user-defined"
>> +                                   " chains is mandatory RETURN");
>
> Wait.
>
> This changes the existing behaviour. I mean, this check rejects rules
> using RETURN from base chains, that should still be there to mimic
> ebtables behaviour. Why change this?
>

I don't see such behaviour change:

Bridge chain: test2, entries: 2, policy: RETURN
-i eth0 -j ACCEPT
-i eth0 -j RETURN

I can still use rules with RETURN target.

The change is in the -P path, not in -j.

>> +             }
>> +             if (strcmp(policy, "ACCEPT") != 0 &&
>> +                 strcmp(policy, "DROP") != 0) {
>> +                     xtables_error(PARAMETER_PROBLEM,
>> +                                   "Default policy in default chains"
>> +                                   " is either ACCEPT or DROP");
>
> Please use the same error message the ebtables uses:
>
> "Policy RETURN only allowed for user defined chains");
>
> And explicitly check for RETURN instead. This is a compat tool, we
> should spot the same errors than the original.
>

Ok, sending v2.
-- 
Arturo Borrero González
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2014-11-24  9:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19 13:11 [ebtables-compat-experimental5 PATCH] iptables: xtables-eb: user-defined chains default policy is always RETURN Arturo Borrero Gonzalez
2014-11-20 12:01 ` Pablo Neira Ayuso
2014-11-20 12:07 ` Pablo Neira Ayuso
2014-11-24  9:46   ` Arturo Borrero Gonzalez [this message]

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=CAOkSjBgr8UicdN80fvtMjiASWC-AWZUr-EG4MuaQqs3VvH34iQ@mail.gmail.com \
    --to=arturo.borrero.glez@gmail.com \
    --cc=giuseppelng@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).