diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-07-02 23:45:57 +0200 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-07-02 23:46:09 +0200 |
commit | ee26c537d7f78e16a1c94bcb933aca853f96bd3d (patch) | |
tree | 7ebb17b3dfd116212ca72ef694dd838e2f462821 /src/starter/confread.c | |
parent | 02571374c43e70275492edde8fe14dab25db0fdf (diff) | |
download | strongswan-ee26c537d7f78e16a1c94bcb933aca853f96bd3d.tar.bz2 strongswan-ee26c537d7f78e16a1c94bcb933aca853f96bd3d.tar.xz |
support of xfrm marks for IKEv2
Diffstat (limited to 'src/starter/confread.c')
-rw-r--r-- | src/starter/confread.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/starter/confread.c b/src/starter/confread.c index e9b9028d5..6ebdaf58b 100644 --- a/src/starter/confread.c +++ b/src/starter/confread.c @@ -671,6 +671,41 @@ static void load_conn(starter_conn_t *conn, kw_list_t *kw, starter_config_t *cfg } break; } + case KW_MARK: + { + char *pos, *endptr; + + pos = strchr(kw->value, '/'); + if (pos) + { + *pos = '\0'; + conn->mark_mask = strtoul(pos+1, &endptr, 0); + if (*endptr != '\0') + { + plog("# invalid mark mask: %s", pos+1); + cfg->err++; + break; + } + } + else + { + conn->mark_mask = 0xffffffff; + } + if (*kw->value == '\0') + { + conn->mark_value = 0; + } + else + { + conn->mark_value = strtoul(kw->value, &endptr, 0); + if (*endptr != '\0') + { + plog("# invalid mark value: %s", kw->value); + cfg->err++; + } + } + break; + } case KW_KEYINGTRIES: if (streq(kw->value, "%forever")) { |