ipsec-types: Support the %unique mark value

This commit is contained in:
Martin Willi
2015-02-20 16:34:53 +01:00
parent b8973b2661
commit cc1682bef9
3 changed files with 18 additions and 6 deletions
+9 -1
View File
@@ -48,7 +48,15 @@ bool mark_from_string(const char *value, mark_t *mark)
{
return FALSE;
}
mark->value = strtoul(value, &endptr, 0);
if (strcasepfx(value, "%unique"))
{
mark->value = MARK_UNIQUE;
endptr = (char*)value + strlen("%unique");
}
else
{
mark->value = strtoul(value, &endptr, 0);
}
if (*endptr)
{
if (*endptr != '/')