diff options
author | Martin Willi <martin@revosec.ch> | 2012-08-27 16:00:13 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-08-30 16:43:43 +0200 |
commit | 7b83cc62e0c02afdf0706e0b809d44d3f610706d (patch) | |
tree | f0b11a94708b9902bd370911509a2c87ae3f70d5 /src/libcharon/plugins/sql | |
parent | b5d2bf975b17f6e9d7a06cf0f8c040448df68872 (diff) | |
download | strongswan-7b83cc62e0c02afdf0706e0b809d44d3f610706d.tar.bz2 strongswan-7b83cc62e0c02afdf0706e0b809d44d3f610706d.tar.xz |
Handle comma separated pools as multiple pool names in SQL plugin
Diffstat (limited to 'src/libcharon/plugins/sql')
-rw-r--r-- | src/libcharon/plugins/sql/sql_config.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libcharon/plugins/sql/sql_config.c b/src/libcharon/plugins/sql/sql_config.c index e215b39b8..c614c679e 100644 --- a/src/libcharon/plugins/sql/sql_config.c +++ b/src/libcharon/plugins/sql/sql_config.c @@ -333,6 +333,7 @@ static peer_cfg_t *build_peer_cfg(private_sql_config_t *this, enumerator_t *e, mediation, mediated_by, p_type; chunk_t l_data, r_data, p_data; char *name, *virtual, *pool; + enumerator_t *enumerator; while (e->enumerate(e, &id, &name, &ike_cfg, &l_type, &l_data, &r_type, &r_data, @@ -379,7 +380,14 @@ static peer_cfg_t *build_peer_cfg(private_sql_config_t *this, enumerator_t *e, } if (pool) { - peer_cfg->add_pool(peer_cfg, pool); + /* attr-sql used comma separated pools, but we now completely + * support multiple pools directly. Support old SQL configs: */ + enumerator = enumerator_create_token(pool, ",", " "); + while (enumerator->enumerate(enumerator, &pool)) + { + peer_cfg->add_pool(peer_cfg, pool); + } + enumerator->destroy(enumerator); } auth = auth_cfg_create(); auth->add(auth, AUTH_RULE_AUTH_CLASS, auth_method); |