aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2005-11-16 16:04:53 +0000
committerMartin Willi <martin@strongswan.org>2005-11-16 16:04:53 +0000
commitdb04a1bc8f53fe981fdcb84d32622b790fcf4ed0 (patch)
tree48c4e63aa7f8bb284abcc98f2059e68c7704e2a5
parent471ade02fc27a858ff005e3267b5c0552fc543d2 (diff)
downloadstrongswan-db04a1bc8f53fe981fdcb84d32622b790fcf4ed0.tar.bz2
strongswan-db04a1bc8f53fe981fdcb84d32622b790fcf4ed0.tar.xz
- spi_t is a u_int64_t now
-rw-r--r--Source/charon/ike_sa_manager.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/Source/charon/ike_sa_manager.c b/Source/charon/ike_sa_manager.c
index 47da146bf..8e88282e4 100644
--- a/Source/charon/ike_sa_manager.c
+++ b/Source/charon/ike_sa_manager.c
@@ -295,15 +295,11 @@ static status_t delete_entry(private_ike_sa_manager_t *this, ike_sa_entry_t *ent
*/
static status_t get_next_spi(private_ike_sa_manager_t *this, spi_t *spi)
{
- this->next_spi.low ++;
- if (this->next_spi.low == 0) {
- /* overflow of lower int in spi */
- this->next_spi.high ++;
- if (this->next_spi.high == 0) {
- /* our software ran so incredible stable, we have no more
- * SPIs to give away :-/. */
- return OUT_OF_RES;
- }
+ this->next_spi++;
+ if (this->next_spi == 0) {
+ /* our software ran so incredible stable, we have no more
+ * SPIs to give away :-/. */
+ return OUT_OF_RES;
}
*spi = this->next_spi;
return SUCCESS;
@@ -715,8 +711,7 @@ ike_sa_manager_t *ike_sa_manager_create()
pthread_mutex_init(&(this->mutex), NULL);
- this->next_spi.low = 1;
- this->next_spi.high = 0;
+ this->next_spi = 0;
return (ike_sa_manager_t*)this;
}