Use network byte order for ESA SPIs
This commit is contained in:
committed by
Tobias Brunner
parent
e2928a3e8c
commit
c57b7a66c3
@@ -149,8 +149,8 @@ METHOD(kernel_ipsec_t, add_sa, status_t,
|
|||||||
*/
|
*/
|
||||||
if (nonce_loc_id == 0 && esa.dh_id == 0)
|
if (nonce_loc_id == 0 && esa.dh_id == 0)
|
||||||
{
|
{
|
||||||
if (ike_esa_create_first(esa_id, esa.isa_id, reqid, 1, ntohl(spi_loc),
|
if (ike_esa_create_first(esa_id, esa.isa_id, reqid, 1, spi_loc, spi_rem)
|
||||||
ntohl(spi_rem)) != TKM_OK)
|
!= TKM_OK)
|
||||||
{
|
{
|
||||||
DBG1(DBG_KNL, "child SA (%llu, first) creation failed", esa_id);
|
DBG1(DBG_KNL, "child SA (%llu, first) creation failed", esa_id);
|
||||||
goto failure;
|
goto failure;
|
||||||
@@ -162,8 +162,8 @@ METHOD(kernel_ipsec_t, add_sa, status_t,
|
|||||||
nonce_type nc_rem;
|
nonce_type nc_rem;
|
||||||
chunk_to_sequence(nonce_rem, &nc_rem, sizeof(nonce_type));
|
chunk_to_sequence(nonce_rem, &nc_rem, sizeof(nonce_type));
|
||||||
if (ike_esa_create_no_pfs(esa_id, esa.isa_id, reqid, 1, nonce_loc_id,
|
if (ike_esa_create_no_pfs(esa_id, esa.isa_id, reqid, 1, nonce_loc_id,
|
||||||
nc_rem, initiator, ntohl(spi_loc),
|
nc_rem, initiator, spi_loc, spi_rem)
|
||||||
ntohl(spi_rem)) != TKM_OK)
|
!= TKM_OK)
|
||||||
{
|
{
|
||||||
DBG1(DBG_KNL, "child SA (%llu, no PFS) creation failed", esa_id);
|
DBG1(DBG_KNL, "child SA (%llu, no PFS) creation failed", esa_id);
|
||||||
goto failure;
|
goto failure;
|
||||||
@@ -176,8 +176,7 @@ METHOD(kernel_ipsec_t, add_sa, status_t,
|
|||||||
nonce_type nc_rem;
|
nonce_type nc_rem;
|
||||||
chunk_to_sequence(nonce_rem, &nc_rem, sizeof(nonce_type));
|
chunk_to_sequence(nonce_rem, &nc_rem, sizeof(nonce_type));
|
||||||
if (ike_esa_create(esa_id, esa.isa_id, reqid, 1, esa.dh_id, nonce_loc_id,
|
if (ike_esa_create(esa_id, esa.isa_id, reqid, 1, esa.dh_id, nonce_loc_id,
|
||||||
nc_rem, initiator, ntohl(spi_loc),
|
nc_rem, initiator, spi_loc, spi_rem) != TKM_OK)
|
||||||
ntohl(spi_rem)) != TKM_OK)
|
|
||||||
{
|
{
|
||||||
DBG1(DBG_KNL, "child SA (%llu) creation failed", esa_id);
|
DBG1(DBG_KNL, "child SA (%llu) creation failed", esa_id);
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|||||||
Reference in New Issue
Block a user