return;
}
+#if FIREWALL_IPTABLES
static void
add_acc_force_nat(fko_srv_options_t *opts, acc_stanza_t *curr_acc, const char *val)
{
return;
}
+#endif
/* Take an IP or Subnet/Mask and convert it to mask for later
* comparisons of incoming source IPs against this mask.
}
else if(CONF_VAR_IS(var, "FORCE_NAT"))
{
+#if FIREWALL_IPTABLES
if(strncasecmp(opts->config[CONF_ENABLE_IPT_FORWARDING], "Y", 1) !=0 )
{
fprintf(stderr,
clean_exit(opts, NO_FW_CLEANUP, EXIT_FAILURE);
}
add_acc_force_nat(opts, curr_acc, val);
+#else
+ fprintf(stderr,
+ "[*] FORCE_NAT not supported.\n");
+ clean_exit(opts, NO_FW_CLEANUP, EXIT_FAILURE);
+#endif
}
else
{
if(res != 0)
{
fprintf(stderr, "Fatal: Errors detected during ipfw rules initialization.\n");
- clean_exit(opts, NO_FW_CLEANUP, EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
/* Allocate our rule_map array for tracking active (and expired) rules.
if(fwc.rule_map == NULL)
{
fprintf(stderr, "Fatal: Memory allocation error in fw_initialize.\n");
- clean_exit(opts, NO_FW_CLEANUP, EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
/* Create a check-state rule if necessary.
|| spadat.message_type == FKO_NAT_ACCESS_MSG
|| spadat.message_type == FKO_CLIENT_TIMEOUT_NAT_ACCESS_MSG)
{
+#if FIREWALL_IPTABLES
if(strncasecmp(opts->config[CONF_ENABLE_IPT_FORWARDING], "Y", 1)!=0)
{
log_msg(LOG_WARNING,
acc = acc->next;
continue;
}
+#else
+ log_msg(LOG_WARNING,
+ "(stanza #%d) SPA packet from %s requested unsupported NAT access",
+ stanza_num, spadat.pkt_source_ip
+ );
+
+ if(ctx != NULL)
+ fko_destroy(ctx);
+ acc = acc->next;
+ continue;
+#endif
}
/* Command messages.