]> git.ipfire.org Git - thirdparty/nftables.git/commit
evaluate: reject: check in bridge and inet the network context in reject
authorAlvaro Neira <alvaroneay@gmail.com>
Wed, 22 Oct 2014 13:25:53 +0000 (15:25 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 24 Oct 2014 10:00:11 +0000 (12:00 +0200)
commit3e6ab2b33514228f892ba6c8389e40c4e82bc980
tree9e857ecb088210e4f6ca1cc06f3021bbf95f52e4
parent9554dd397309be84a96424d8087a5980638d7380
evaluate: reject: check in bridge and inet the network context in reject

In Inet tables, we have to check the network context in rules that we use
icmp or icmpv6 reason in reject. To be sure that the context is the correct.
However, for icmpx and tcp reject, we don't need to check it.

In Bridge tables, ee have vlan and arp traffic and they are not supported.
For this things, we have to check the network context. For example:

  nft add rule bridge test-bridge input \
ether type arp reject with icmp type host-unreachable
or
  nft add rule bridge test-bridge input \
   ether type vlan reject with tcp reset

In that cases, we have to throw an error. Moreover, we have to accept rules
that the network context is Ipv4 and Ipv6. For example:

  nft add rule -nnn bridge test-bridge input \
ip protocol tcp reject with tcp reset

Moreover, this patch refactor the code for check the family for bridge and inet
tables.

Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c