]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xshared: Do not omit all-wildcard interface spec when inverted
authorPhil Sutter <phil@nwl.cc>
Fri, 26 Jul 2024 18:05:48 +0000 (20:05 +0200)
committerPhil Sutter <phil@nwl.cc>
Wed, 31 Jul 2024 21:13:55 +0000 (23:13 +0200)
The rule parses correctly, but the (never matching) part is lost on
output.

Looks like a day-1 bug, make it fix the change after which it applies
cleanly.

Fixes: b2197e7834f77 ("xshared: Entirely ignore interface masks when saving rules")
Signed-off-by: Phil Sutter <phil@nwl.cc>
extensions/iptables.t
extensions/libarpt_standard.t
extensions/libebt_standard.t
iptables/xshared.c

index 5d6d3d15cc5fdf3b245853dae18995d0c7fe9d95..2817c3fb8437f6c68edd4918390cab531a725320 100644 (file)
@@ -4,6 +4,8 @@
 -i eth+ -o alongifacename+;=;OK
 ! -i eth0;=;OK
 ! -o eth+;=;OK
+-i + -j ACCEPT;-j ACCEPT;OK
+! -i +;=;OK
 -c "";;FAIL
 -c ,3;;FAIL
 -c 3,;;FAIL
index 153540903f7864c3e62a37010846cf046a155cc8..d6eaced3bd5e38d91e2f6452522a78a2ab845c05 100644 (file)
@@ -9,6 +9,8 @@
 -j ACCEPT ! -i lo;=;OK
 -i ppp+;=;OK
 ! -i ppp+;=;OK
+-i + -j ACCEPT;-j ACCEPT;OK
+! -i +;=;OK
 -i lo --destination-mac 11:22:33:44:55:66;-i lo --dst-mac 11:22:33:44:55:66;OK
 --source-mac Unicast;--src-mac 00:00:00:00:00:00/01:00:00:00:00:00;OK
 ! --src-mac Multicast;! --src-mac 01:00:00:00:00:00/01:00:00:00:00:00;OK
index 3f1a459cb9814283e21d07df5f2e58748ad408e7..4cf1f4cfa3ae5a9e575b13f1d87adecbcaf812de 100644 (file)
 --logical-out br1;=;FAIL
 -i + -d 00:0f:ee:d0:ba:be;-d 00:0f:ee:d0:ba:be;OK
 -i + -p ip;-p IPv4;OK
+! -i +;=;OK
 --logical-in + -d 00:0f:ee:d0:ba:be;-d 00:0f:ee:d0:ba:be;OK
 --logical-in + -p ip;-p IPv4;OK
+! --logical-in +;=;OK
 :FORWARD
 -i foobar;=;OK
 -o foobar;=;OK
index b1997ea35f8f8055df18bbeed20abec406102f23..8c7df3c986eed4b54129db5112a81eb3b1bcd5f3 100644 (file)
@@ -759,7 +759,7 @@ void print_ifaces(const char *iniface, const char *outiface, uint8_t invflags,
 
 void save_iface(char letter, const char *iface, int invert)
 {
-       if (!strlen(iface) || !strcmp(iface, "+"))
+       if (!strlen(iface) || (!strcmp(iface, "+") && !invert))
                return;
 
        printf("%s -%c %s", invert ? " !" : "", letter, iface);