summaryrefslogtreecommitdiff
path: root/src/starter/confread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/starter/confread.c')
-rw-r--r--src/starter/confread.c50
1 files changed, 3 insertions, 47 deletions
diff --git a/src/starter/confread.c b/src/starter/confread.c
index 2fb022692..19178a2c3 100644
--- a/src/starter/confread.c
+++ b/src/starter/confread.c
@@ -375,47 +375,6 @@ static void handle_firewall(const char *label, starter_end_t *end,
}
}
-static bool handle_mark(char *value, mark_t *mark)
-{
- char *sep, *endptr;
-
- sep = strchr(value, '/');
- if (sep)
- {
- *sep = '\0';
- mark->mask = strtoul(sep+1, &endptr, 0);
- if (*endptr != '\0')
- {
- DBG1(DBG_APP, "# invalid mark mask: %s", sep+1);
- return FALSE;
- }
- }
- else
- {
- mark->mask = 0xffffffff;
- }
- if (value == '\0')
- {
- mark->value = 0;
- }
- else
- {
- mark->value = strtoul(value, &endptr, 0);
- if (*endptr != '\0')
- {
- DBG1(DBG_APP, "# invalid mark value: %s", value);
- return FALSE;
- }
- }
- if (sep)
- { /* restore the original text in case also= is used */
- *sep = '/';
- }
- /* apply the mask to ensure the value is in range */
- mark->value &= mark->mask;
- return TRUE;
-}
-
/*
* parse a conn section
*/
@@ -521,11 +480,8 @@ static void load_conn(starter_conn_t *conn, kw_list_t *kw, starter_config_t *cfg
case KW_COMPRESS:
KW_SA_OPTION_FLAG("yes", "no", SA_OPTION_COMPRESS)
break;
- case KW_AUTH:
- KW_SA_OPTION_FLAG("ah", "esp", SA_OPTION_AUTHENTICATE)
- break;
case KW_MARK:
- if (!handle_mark(kw->value, &conn->mark_in))
+ if (!mark_from_string(kw->value, &conn->mark_in))
{
cfg->err++;
break;
@@ -533,13 +489,13 @@ static void load_conn(starter_conn_t *conn, kw_list_t *kw, starter_config_t *cfg
conn->mark_out = conn->mark_in;
break;
case KW_MARK_IN:
- if (!handle_mark(kw->value, &conn->mark_in))
+ if (!mark_from_string(kw->value, &conn->mark_in))
{
cfg->err++;
}
break;
case KW_MARK_OUT:
- if (!handle_mark(kw->value, &conn->mark_out))
+ if (!mark_from_string(kw->value, &conn->mark_out))
{
cfg->err++;
}