aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-12-11 15:38:28 +0100
committerMartin Willi <martin@revosec.ch>2014-06-04 16:32:07 +0200
commitcd88f818fa48da9797910653c97bdb4ffc9fd0c5 (patch)
tree3d5255195ddffe0df0f9bf873ee884eb52feeea2
parentaf098b500812db1384dd580d693f7a624679ecd8 (diff)
downloadstrongswan-cd88f818fa48da9797910653c97bdb4ffc9fd0c5.tar.bz2
strongswan-cd88f818fa48da9797910653c97bdb4ffc9fd0c5.tar.xz
kernel-wfp: Increment SPIs properly, that is while in host order
-rw-r--r--src/libcharon/plugins/kernel_wfp/kernel_wfp_ipsec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcharon/plugins/kernel_wfp/kernel_wfp_ipsec.c b/src/libcharon/plugins/kernel_wfp/kernel_wfp_ipsec.c
index e8ef277dd..9073dec33 100644
--- a/src/libcharon/plugins/kernel_wfp/kernel_wfp_ipsec.c
+++ b/src/libcharon/plugins/kernel_wfp/kernel_wfp_ipsec.c
@@ -1003,7 +1003,7 @@ METHOD(kernel_ipsec_t, get_spi, status_t,
private_kernel_wfp_ipsec_t *this, host_t *src, host_t *dst,
u_int8_t protocol, u_int32_t reqid, u_int32_t *spi)
{
- *spi = ref_get(&this->nextspi);
+ *spi = htonl(ref_get(&this->nextspi));
return SUCCESS;
}
@@ -1433,7 +1433,7 @@ kernel_wfp_ipsec_t *kernel_wfp_ipsec_create()
.providerKey = { 0x59cdae2e, 0xf6bb, 0x4c09,
{ 0xa9,0x59,0x9d,0x91,0xac,0xaf,0xf9,0x19 }},
},
- .nextspi = htonl(0xc0000001),
+ .nextspi = 0xc0000001,
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
.tsas = hashtable_create(hashtable_hash_ptr, hashtable_equals_ptr, 4),
.isas = hashtable_create((void*)hash_sa, (void*)equals_sa, 4),