]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nft_meta: improve the validity check of pkttype set expr
authorLiping Zhang <liping.zhang@spreadtrum.com>
Mon, 22 Aug 2016 14:57:56 +0000 (22:57 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 25 Aug 2016 11:12:03 +0000 (13:12 +0200)
commit7e38c200fd11807fd8e3144b8229aa162424bcd4
tree964e1af7530b7629961c4c825bd50629f73db81f
parent1c597a51d90e1bf744efa4dbc01da74513d0eca0
netfilter: nft_meta: improve the validity check of pkttype set expr

"meta pkttype set" is only supported on prerouting chain with bridge
family and ingress chain with netdev family.

But the validate check is incomplete, and the user can add the nft
rules on input chain with bridge family, for example:
  # nft add table bridge filter
  # nft add chain bridge filter input {type filter hook input \
    priority 0 \;}
  # nft add chain bridge filter test
  # nft add rule bridge filter test meta pkttype set unicast
  # nft add rule bridge filter input jump test

This patch fixes the problem.

Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nft_meta.h
net/bridge/netfilter/nft_meta_bridge.c
net/netfilter/nft_meta.c