simplified SPI allocation after refactorings

This commit is contained in:
Martin Willi
2009-05-14 10:28:18 +02:00
parent d50746febe
commit 64e8ca281f
+1 -16
View File
@@ -410,27 +410,12 @@ static u_int32_t get_lifetime(private_child_sa_t *this, bool hard)
*/ */
static u_int32_t alloc_spi(private_child_sa_t *this, protocol_id_t protocol) static u_int32_t alloc_spi(private_child_sa_t *this, protocol_id_t protocol)
{ {
switch (protocol)
{
case PROTO_AH:
if (charon->kernel_interface->get_spi(charon->kernel_interface, if (charon->kernel_interface->get_spi(charon->kernel_interface,
this->other_addr, this->my_addr, PROTO_AH, this->other_addr, this->my_addr, protocol,
this->reqid, &this->my_spi) == SUCCESS) this->reqid, &this->my_spi) == SUCCESS)
{ {
return this->my_spi; return this->my_spi;
} }
break;
case PROTO_ESP:
if (charon->kernel_interface->get_spi(charon->kernel_interface,
this->other_addr, this->my_addr, PROTO_ESP,
this->reqid, &this->my_spi) == SUCCESS)
{
return this->my_spi;
}
break;
default:
break;
}
return 0; return 0;
} }