properly convert boolean flags when parsing ipsec.conf
This commit is contained in:
+11
-3
@@ -365,15 +365,23 @@ assign_arg(kw_token_t token, kw_token_t first, kw_list_t *kw, char *base
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
case ARG_ENUM:
|
case ARG_ENUM:
|
||||||
{
|
{
|
||||||
int *i = (int *)p;
|
|
||||||
|
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
{
|
{
|
||||||
plog("# bad enumeration value: %s=%s (%d)"
|
plog("# bad enumeration value: %s=%s (%d)"
|
||||||
, kw->entry->name, kw->value, index);
|
, kw->entry->name, kw->value, index);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
*i = index;
|
|
||||||
|
if (token_info[token].list == LST_bool)
|
||||||
|
{
|
||||||
|
bool *b = (bool *)p;
|
||||||
|
*b = (index > 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int *i = (int *)p;
|
||||||
|
*i = index;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user