ipfw active/expire test bug fix (atoi() for config vars)
authorMichael Rash <mbr@cipherdyne.org>
Fri, 17 Aug 2012 02:30:09 +0000 (22:30 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Fri, 17 Aug 2012 02:30:09 +0000 (22:30 -0400)
server/config_init.c
test/test-fwknop.pl

index 2ac667a..70c3e7c 100644 (file)
@@ -153,10 +153,10 @@ validate_int_var_ranges(fko_srv_options_t *opts)
     /* Make sure the active and expire sets are not identical whenever
      * they are non-zero
     */
-    if((opts->config[CONF_IPFW_ACTIVE_SET_NUM] > 0
-            && opts->config[CONF_IPFW_EXPIRE_SET_NUM] > 0)
-            && (opts->config[CONF_IPFW_ACTIVE_SET_NUM]
-                == opts->config[CONF_IPFW_EXPIRE_SET_NUM]))
+    if((atoi(opts->config[CONF_IPFW_ACTIVE_SET_NUM]) > 0
+            && atoi(opts->config[CONF_IPFW_EXPIRE_SET_NUM]) > 0)
+            && atoi(opts->config[CONF_IPFW_ACTIVE_SET_NUM])
+                == atoi(opts->config[CONF_IPFW_EXPIRE_SET_NUM]))
     {
         fprintf(stderr,
                 "[*] Cannot set identical ipfw active and expire sets.\n");
index 48eb4f4..0fd8adf 100755 (executable)
@@ -1174,8 +1174,7 @@ my @tests = (
             "$fwknopdCmd -c $cf{'ipfw_active_expire'} -a $cf{'def_access'} " .
             "-d $default_digest_file -p $default_pid_file $intf_str",
         'server_positive_output_matches' => [qr/Cannot\sset\sidentical\sipfw\sactive\sand\sexpire\ssets/],
-        'fw_rule_created' => $NEW_RULE_REQUIRED,
-        'fw_rule_removed' => $NEW_RULE_REMOVED,
+        'fw_rule_created' => $REQUIRE_NO_NEW_RULE,
         'fatal'    => $NO
     },