- spi_t is a u_int64_t now

This commit is contained in:
Martin Willi
2005-11-16 16:04:53 +00:00
parent 471ade02fc
commit db04a1bc8f
+6 -11
View File
@@ -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) static status_t get_next_spi(private_ike_sa_manager_t *this, spi_t *spi)
{ {
this->next_spi.low ++; this->next_spi++;
if (this->next_spi.low == 0) { if (this->next_spi == 0) {
/* overflow of lower int in spi */ /* our software ran so incredible stable, we have no more
this->next_spi.high ++; * SPIs to give away :-/. */
if (this->next_spi.high == 0) { return OUT_OF_RES;
/* our software ran so incredible stable, we have no more
* SPIs to give away :-/. */
return OUT_OF_RES;
}
} }
*spi = this->next_spi; *spi = this->next_spi;
return SUCCESS; return SUCCESS;
@@ -715,8 +711,7 @@ ike_sa_manager_t *ike_sa_manager_create()
pthread_mutex_init(&(this->mutex), NULL); pthread_mutex_init(&(this->mutex), NULL);
this->next_spi.low = 1; this->next_spi = 0;
this->next_spi.high = 0;
return (ike_sa_manager_t*)this; return (ike_sa_manager_t*)this;
} }