diff options
author | Yves-Alexis Perez <corsac@debian.org> | 2013-08-25 15:37:26 +0200 |
---|---|---|
committer | Yves-Alexis Perez <corsac@debian.org> | 2013-08-25 15:37:26 +0200 |
commit | 6b99c8d9cff7b3e8ae8f3204b99e7ea40f791349 (patch) | |
tree | 009fc492961e13860d2a4bc2de8caf2bbe2975e7 /src/libhydra/plugins/attr/attr_provider.c | |
parent | c83921a2b566aa9d55d8ccc7258f04fca6292ee6 (diff) | |
download | vyos-strongswan-6b99c8d9cff7b3e8ae8f3204b99e7ea40f791349.tar.gz vyos-strongswan-6b99c8d9cff7b3e8ae8f3204b99e7ea40f791349.zip |
Imported Upstream version 5.1.0
Diffstat (limited to 'src/libhydra/plugins/attr/attr_provider.c')
-rw-r--r-- | src/libhydra/plugins/attr/attr_provider.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/libhydra/plugins/attr/attr_provider.c b/src/libhydra/plugins/attr/attr_provider.c index 329f317dd..1a2fa7f28 100644 --- a/src/libhydra/plugins/attr/attr_provider.c +++ b/src/libhydra/plugins/attr/attr_provider.c @@ -219,7 +219,7 @@ static void load_entries(private_attr_provider_t *this) host = host_create_from_string(token, 0); if (!host) { - if (!type) + if (mapped) { DBG1(DBG_CFG, "invalid host in key %s: %s", key, token); continue; @@ -252,9 +252,21 @@ static void load_entries(private_attr_provider_t *this) } } host->destroy(host); + if (mapped) + { + switch (family) + { + case AF_INET: + type = mapped->v4; + break; + case AF_INET6: + type = mapped->v6; + break; + } + } } INIT(entry, - .type = type ?: (family == AF_INET ? mapped->v4 : mapped->v6), + .type = type, .value = data, ); DBG2(DBG_CFG, "loaded attribute %N: %#B", @@ -308,4 +320,3 @@ attr_provider_t *attr_provider_create(database_t *db) return &this->public; } - |