diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2017-03-03 21:50:22 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2017-03-03 21:50:22 +0100 |
commit | ffdc293b9dc0ed746a31fcf20765c2d5e85e9c70 (patch) | |
tree | 715ce257233c4358d13e3c731529e7d2adada214 /ldpd/pfkey.c | |
parent | ldpd: always check if the received labels are valid (diff) | |
download | frr-ffdc293b9dc0ed746a31fcf20765c2d5e85e9c70.tar.xz frr-ffdc293b9dc0ed746a31fcf20765c2d5e85e9c70.zip |
ldpd: add missing htonl and ntohl in PF_KEY code
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to '')
-rw-r--r-- | ldpd/pfkey.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ldpd/pfkey.c b/ldpd/pfkey.c index 29f763e6a..88a778ccc 100644 --- a/ldpd/pfkey.c +++ b/ldpd/pfkey.c @@ -131,7 +131,7 @@ pfkey_send(int sd, uint8_t satype, uint8_t mtype, uint8_t dir, 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; } @@ -280,7 +280,7 @@ pfkey_read(int sd, struct sadb_msg *h) } 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; @@ -317,7 +317,7 @@ pfkey_reply(int sd, uint32_t *spip) } if (hdr.sadb_msg_type == SADB_GETSPI) { - if (spip == NULL) { + if (spi == NULL) { explicit_bzero(data, len); free(data); return (0); @@ -331,7 +331,7 @@ pfkey_reply(int sd, uint32_t *spip) 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; } } |