]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Fix "empty policy element" complaining in non-strict mode.
authorNoticed by Tom Eastep <teastep@shorewall.net>
Sun, 22 Jan 2006 13:47:07 +0000 (13:47 +0000)
committerPatrick McHardy <kaber@trash.net>
Sun, 22 Jan 2006 13:47:07 +0000 (13:47 +0000)
Noticed by Tom Eastep <teastep@shorewall.net>.

extensions/libip6t_policy.c
extensions/libipt_policy.c

index 7498e989d81dbc622a086d29148ac8daaba0b9e0..54cd5f2badafa5dc203670c4b294889be9b08bc0 100644 (file)
@@ -327,7 +327,8 @@ static void final_check(unsigned int flags)
        for (i = 0; i < info->len; i++) {
                e = &info->pol[i];
 
-                if (!(e->match.reqid || e->match.spi || e->match.saddr ||
+                if (info->flags & IP6T_POLICY_MATCH_STRICT &&
+                   !(e->match.reqid || e->match.spi || e->match.saddr ||
                       e->match.daddr || e->match.proto || e->match.mode))
                         exit_error(PARAMETER_PROBLEM,
                                    "policy match: empty policy element");
index 593bb11f4a346f506a6c39ae1a39026ac4bfe33b..55b969d15873702d7374ab473d8800e0df757a27 100644 (file)
@@ -287,7 +287,8 @@ static void final_check(unsigned int flags)
        for (i = 0; i < info->len; i++) {
                e = &info->pol[i];
 
-               if (!(e->match.reqid || e->match.spi || e->match.saddr ||
+               if (info->flags & IPT_POLICY_MATCH_STRICT &&
+                   !(e->match.reqid || e->match.spi || e->match.saddr ||
                      e->match.daddr || e->match.proto || e->match.mode))
                        exit_error(PARAMETER_PROBLEM,
                                   "policy match: empty policy element");