netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Álvaro Neira Ayuso" <alvaroneay@gmail.com>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [nft PATCH 4/4 v3] nft: complete reject support
Date: Mon, 22 Sep 2014 18:23:18 +0200	[thread overview]
Message-ID: <54204CF6.6050007@gmail.com> (raw)
In-Reply-To: <20140922082058.GK4971@acer.localdomain>

El 22/09/14 10:20, Patrick McHardy escribió:
> On Sun, Sep 21, 2014 at 09:32:37PM +0200, Alvaro Neira Ayuso wrote:
>> This patch allows to use the reject action in rules. Example:
>>
>>    nft add rule filter input udp dport 22 reject
>>
>> In this rule, we assume that the reason is network unreachable. Also
>> we can specify the reason with the option "with" and the reason. Example:
>>
>>    nft add rule filter input tcp dport 22 reject with host-unreach
>>
>> In the bridge tables and inet tables, we can use this action too. Example:
>>
>>    nft add rule inet filter input reject with icmp-host-unreach
>>
>> In this rule above, this generates a meta nfproto dependency to match
>> ipv4 traffic because we use a icmpv4 reason to reject.
>>
>> If the reason is not specified, we infer it from the context.
>
> There are a couple of things I don't like very much about this concept.
>
> First of all, the types have redundant information (icmp-*, icmpv6-*).
> This might not look to bad if you only consider the reject statement,
> but the redundancy becomes very obvious if you consider a set declaration
> which explicitly specifies the data type and still has to use the icmp
> prefix for every value.
>
> Its also not consistent with the remaining keywords, we don't use
> tcp-syn, tcp-fin etc.
>
> I also don't like having a reject specific family, without taking extra
> care this prevents protocol conflict detection and determination of
> the protocol for following expressions.
>
> I'd rather have this very explicit:
>
> reject with icmp host-unreachable
> reject with icmpv6 host-unreachable
> reject with icmp
>
> So the protocol would be an explizit parameter without strcmp hacks and
> the type keywords would not encode the protocol. I'd also not be
> against just using the exact same syntax as for matches:
>
> reject with icmp type host-unreach (note the extra "type").
>
>> Insufficient context for using reject
>>    * nft add rule inet filter input reject
>>    * nft add rule bridge filter input reject
>
> Well, we do have the inet reject expression and I consider it important
> that we actually support it, we want to help make easier rulesets.
>
> It does actually work today without a specific type as in your example,
> so why wouldn't this work anymore?
>
> I actually think we should add full support for this by adding an
> inet-specific ICMP type table which is the intersection of the ICMP
> and ICMPv6 types for inet and map those to the corresponding real
> types:
>
> nft inet filter input reject with host-unreachable
>

I have seen the ICMP and ICMPv6 types and I have done this map:

CODE		 |	ICMPv6		|	ICMPv4
admin-prohibited | admin-prohibited	|	admin-prohibited
port-unreach	 | port-unreach		|	port-unreach
no-route	 | no-route		|	net-unreach
host-unreach	 | addr-unreach		|	host-unreach

What do you think?
--
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-09-22 16:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-21 19:32 [nft PATCH 1/4] payload: generate dependency in the appropriate byteorder Alvaro Neira Ayuso
2014-09-21 19:32 ` [nft PATCH 2/4] src: Enhance payload_gen_dependency() Alvaro Neira Ayuso
2014-09-21 19:32 ` [nft PATCH 3/4] datatype: add symbolic_constant_parse_table() Alvaro Neira Ayuso
2014-09-22  7:59   ` Patrick McHardy
2014-09-22  9:05     ` Álvaro Neira Ayuso
2014-09-22 10:06       ` Patrick McHardy
2014-09-21 19:32 ` [nft PATCH 4/4 v3] nft: complete reject support Alvaro Neira Ayuso
2014-09-22  8:20   ` Patrick McHardy
2014-09-22 16:23     ` Álvaro Neira Ayuso [this message]
2014-09-23  6:43       ` Patrick McHardy
2014-09-22  7:54 ` [nft PATCH 1/4] payload: generate dependency in the appropriate byteorder Patrick McHardy
2014-09-22  9:01   ` Álvaro Neira Ayuso

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=54204CF6.6050007@gmail.com \
    --to=alvaroneay@gmail.com \
    --cc=kaber@trash.net \
    --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 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).