summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Westphal <renato@cvs.openbsd.org>2017-03-02 19:54:23 +0000
committerRenato Westphal <renato@cvs.openbsd.org>2017-03-02 19:54:23 +0000
commit3569d5a214e71d468083fca94af544868a47d3c2 (patch)
tree0a3b3d8bb6016eaabaa0fe59bba6fe842a3ff89a
parent0f90a0da76ca8fea0ae9b6a262c07c118fac9ebb (diff)
Fix breakage of md5 authentication.
The previous commit (rev 1.47) added a missing htonl in pfkey_send() but didn't add a corresponding ntohl in pfkey_reply(). This patch fixes this. Found the hard way by benno@, who also suggested the rename of spip to spi. OK benno@ claudio@ henning@
-rw-r--r--usr.sbin/bgpd/pfkey.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/pfkey.c b/usr.sbin/bgpd/pfkey.c
index 4be700279f8..b8d200d3de5 100644
--- a/usr.sbin/bgpd/pfkey.c
+++ b/usr.sbin/bgpd/pfkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkey.c,v 1.47 2017/02/22 13:55:14 renato Exp $ */
+/* $OpenBSD: pfkey.c,v 1.48 2017/03/02 19:54:22 renato Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -434,7 +434,7 @@ pfkey_read(int sd, struct sadb_msg *h)
}
int
-pfkey_reply(int sd, u_int32_t *spip)
+pfkey_reply(int sd, u_int32_t *spi)
{
struct sadb_msg hdr, *msg;
struct sadb_ext *ext;
@@ -471,7 +471,7 @@ pfkey_reply(int sd, u_int32_t *spip)
}
if (hdr.sadb_msg_type == SADB_GETSPI) {
- if (spip == NULL) {
+ if (spi == NULL) {
explicit_bzero(data, len);
free(data);
return (0);
@@ -485,7 +485,7 @@ pfkey_reply(int sd, u_int32_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;
}
}