From: Florian Westphal Date: Fri, 2 Nov 2018 15:24:24 +0000 (+0100) Subject: ebtables: relax -t table restriction, add snat/dnat test cases X-Git-Tag: v1.8.2~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd90cef0c18a996f499c9e31fff7ee0554fe39f9;p=thirdparty%2Fiptables.git ebtables: relax -t table restriction, add snat/dnat test cases Its artificial and prevents test cases that need to add rules to a different table from working. The test script generates: -A PREROUTING -t nat ... which works fine for iptables and ip6tables. Just accept it for ebtables too and add test cases for snat and dnat. Signed-off-by: Florian Westphal --- diff --git a/extensions/libebt_dnat.t b/extensions/libebt_dnat.t new file mode 100644 index 00000000..42f9bff2 --- /dev/null +++ b/extensions/libebt_dnat.t @@ -0,0 +1,5 @@ +:PREROUTING +*nat +-i someport -j dnat --to-dst de:ad:0:be:ee:ff;-i someport -j dnat --to-dst de:ad:0:be:ee:ff --dnat-target ACCEPT;OK +-j dnat --to-dst de:ad:0:be:ee:ff --dnat-target ACCEPT;=;OK +-j dnat --to-dst de:ad:0:be:ee:ff --dnat-target CONTINUE;=;OK diff --git a/extensions/libebt_snat.t b/extensions/libebt_snat.t new file mode 100644 index 00000000..bb42e758 --- /dev/null +++ b/extensions/libebt_snat.t @@ -0,0 +1,4 @@ +:POSTROUTING +*nat +-o someport -j snat --to-source a:b:c:d:e:f;-o someport -j snat --to-src a:b:c:d:e:f --snat-target ACCEPT;OK +-o someport+ -j snat --to-src de:ad:0:be:ee:ff --snat-target CONTINUE;=;OK diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c index 721bab57..c36c12e6 100644 --- a/iptables/xtables-eb.c +++ b/iptables/xtables-eb.c @@ -1000,9 +1000,6 @@ print_zero: } break; case 't': /* Table */ - if (OPT_COMMANDS) - xtables_error(PARAMETER_PROBLEM, - "Please put the -t option first"); ebt_check_option2(&flags, OPT_TABLE); if (strlen(optarg) > EBT_TABLE_MAXNAMELEN - 1) xtables_error(PARAMETER_PROBLEM,