diff options
-rw-r--r-- | extensions/libip6t_policy.c | 3 | ||||
-rw-r--r-- | extensions/libipt_policy.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/extensions/libip6t_policy.c b/extensions/libip6t_policy.c index 7498e98..54cd5f2 100644 --- a/extensions/libip6t_policy.c +++ b/extensions/libip6t_policy.c @@ -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"); diff --git a/extensions/libipt_policy.c b/extensions/libipt_policy.c index 593bb11..55b969d 100644 --- a/extensions/libipt_policy.c +++ b/extensions/libipt_policy.c @@ -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"); |