diff options
author | Martin Willi <martin@strongswan.org> | 2008-11-12 15:09:24 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2008-11-12 15:09:24 +0000 |
commit | b8cbb6451cb7d05a21c56e478a2d20c432e4b21a (patch) | |
tree | de2c0933cb71c302ef51e81aa641aab9c08b9727 /src/charon/plugins/sql/sql_attribute.c | |
parent | 9fa5c75f48bd65db556d8209084da14cb4001503 (diff) | |
download | strongswan-b8cbb6451cb7d05a21c56e478a2d20c432e4b21a.tar.bz2 strongswan-b8cbb6451cb7d05a21c56e478a2d20c432e4b21a.tar.xz |
ported some hard-to-merge cherries back to trunk :-/
shame, svn, shame: this was ways to complicated
we should consider a switch to git...
Diffstat (limited to 'src/charon/plugins/sql/sql_attribute.c')
-rw-r--r-- | src/charon/plugins/sql/sql_attribute.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/charon/plugins/sql/sql_attribute.c b/src/charon/plugins/sql/sql_attribute.c index f1e206279..486a432ca 100644 --- a/src/charon/plugins/sql/sql_attribute.c +++ b/src/charon/plugins/sql/sql_attribute.c @@ -45,22 +45,6 @@ struct private_sql_attribute_t { }; /** - * read a host_t address from the addresses table - */ -static host_t *host_from_chunk(chunk_t chunk) -{ - switch (chunk.len) - { - case 4: - return host_create_from_chunk(AF_INET, chunk, 0); - case 16: - return host_create_from_chunk(AF_INET6, chunk, 0); - default: - return NULL; - } -} - -/** * lookup/insert an identity */ static u_int get_identity(private_sql_attribute_t *this, identification_t *id) @@ -145,7 +129,7 @@ static host_t *get_address(private_sql_attribute_t *this, char *name, "WHERE id = ? AND identity = ? AND released != 0", DB_UINT, now, DB_UINT, id, DB_UINT, identity) > 0) { - host = host_from_chunk(address); + host = host_create_from_chunk(AF_UNSPEC, address, 0); if (host) { DBG1(DBG_CFG, "acquired existing lease " @@ -177,7 +161,7 @@ static host_t *get_address(private_sql_attribute_t *this, char *name, DB_UINT, now, DB_UINT, identity, DB_UINT, id, DB_UINT, now - timeout) > 0) { - host = host_from_chunk(address); + host = host_create_from_chunk(AF_UNSPEC, address, 0); if (host) { DBG1(DBG_CFG, "acquired new lease " |