sa.sadb_sa_exttype = SADB_EXT_SA;
sa.sadb_sa_len = sizeof(sa) / 8;
sa.sadb_sa_replay = 0;
- sa.sadb_sa_spi = spi;
+ sa.sadb_sa_spi = htonl(spi);
sa.sadb_sa_state = SADB_SASTATE_MATURE;
break;
}
}
static int
-pfkey_reply(int sd, uint32_t *spip)
+pfkey_reply(int sd, uint32_t *spi)
{
struct sadb_msg hdr, *msg;
struct sadb_ext *ext;
}
if (hdr.sadb_msg_type == SADB_GETSPI) {
- if (spip == NULL) {
+ if (spi == NULL) {
explicit_bzero(data, len);
free(data);
return (0);
ext->sadb_ext_len * PFKEY2_CHUNK)) {
if (ext->sadb_ext_type == SADB_EXT_SA) {
sa = (struct sadb_sa *) ext;
- *spip = sa->sadb_sa_spi;
+ *spi = ntohl(sa->sadb_sa_spi);
break;
}
}