summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrenato <renato@openbsd.org>2017-03-02 19:54:22 +0000
committerrenato <renato@openbsd.org>2017-03-02 19:54:22 +0000
commitaee77287f2ad968cf6e007b0df4540f79e21d880 (patch)
tree19a7f522b0303a9ee341224facbf26afa19f5c94
parentNow that the kernel provides information about IPsec SA bundles, (diff)
downloadwireguard-openbsd-aee77287f2ad968cf6e007b0df4540f79e21d880.tar.xz
wireguard-openbsd-aee77287f2ad968cf6e007b0df4540f79e21d880.zip
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;
}
}