* comparisons of incoming source IPs against this mask.
*/
static void
-add_source_mask(acc_stanza_t *acc, const char *ip)
+add_source_mask(fko_srv_options_t *opts, acc_stanza_t *acc, const char *ip)
{
char *ndx;
char ip_str[MAX_IPV4_STR_LEN] = {0};
log_msg(LOG_ERR,
"Fatal memory allocation error adding stanza source_list entry"
);
- exit(EXIT_FAILURE);
+ clean_exit(opts, NO_FW_CLEANUP, EXIT_FAILURE);
}
/* If this is not the first entry, we walk our pointer to the
if(inet_aton(ip_str, &in) == 0)
{
log_msg(LOG_ERR,
- "Error parsing IP to int for: %s", ip_str
+ "Fatal error parsing IP to int for: %s", ip_str
);
-
- free(new_sle);
- new_sle = NULL;
-
- return;
+ clean_exit(opts, NO_FW_CLEANUP, EXIT_FAILURE);
}
/* Store our mask converted from CIDR to a 32-bit value.
/* Expand the access SOURCE string to a list of masks.
*/
void
-expand_acc_source(acc_stanza_t *acc)
+expand_acc_source(fko_srv_options_t *opts, acc_stanza_t *acc)
{
char *ndx, *start;
char buf[32];
start++;
strlcpy(buf, start, (ndx-start)+1);
- add_source_mask(acc, buf);
+ add_source_mask(opts, acc, buf);
start = ndx+1;
}
}
start++;
strlcpy(buf, start, (ndx-start)+1);
- add_source_mask(acc, buf);
+ add_source_mask(opts, acc, buf);
}
static int
{
/* Expand the source string to 32-bit integer masks foreach entry.
*/
- expand_acc_source(acc);
+ expand_acc_source(opts, acc);
/* Now expand the open_ports string.
*/