]> git.ipfire.org Git - thirdparty/iptables.git/commit
iptables-translate: add in/out ifname wildcard match translation to nft
authorLiping Zhang <liping.zhang@spreadtrum.com>
Sat, 30 Jul 2016 05:20:59 +0000 (13:20 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 1 Aug 2016 12:21:27 +0000 (14:21 +0200)
commit0ddd663e9c167f9f0451dac8c02bbfcda25fe15e
treecf45f737d411decb39d13c4bec30a3872a94f7f9
parent68c57e809f69108694cce2d502a3ed1c328d13e8
iptables-translate: add in/out ifname wildcard match translation to nft

In iptables, "-i eth+" means match all in ifname with the prefix "eth".
But in nftables, this was changed to "iifname eth*". So we should handle
this subtle difference.

Apply this patch, translation will become:
  # iptables-translate -A INPUT -i eth+
  nft add rule ip filter INPUT iifname eth* counter
  # ip6tables-translate -A OUTPUT ! -o eth+
  nft add rule ip6 filter OUTPUT oifname != eth* counter

Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/nft-ipv4.c
iptables/nft-ipv6.c
iptables/nft.h
iptables/xtables-translate.c