summaryrefslogtreecommitdiff
path: root/sbin/isakmpd
diff options
context:
space:
mode:
authorHakan Olsson <ho@cvs.openbsd.org>2002-06-11 18:04:29 +0000
committerHakan Olsson <ho@cvs.openbsd.org>2002-06-11 18:04:29 +0000
commit230b2070bb6f1dd42c93a1dcbc2ef5bc3f698480 (patch)
tree328d74b174484ae6c2acdb56f7e4ee255c46208d /sbin/isakmpd
parent52b86358a062cc921b77a39c77976cfb693adf62 (diff)
Stupid 16-bit CPI numbers.
Diffstat (limited to 'sbin/isakmpd')
-rw-r--r--sbin/isakmpd/pf_key_v2.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sbin/isakmpd/pf_key_v2.c b/sbin/isakmpd/pf_key_v2.c
index e6cdbb1af15..b4ef3dab478 100644
--- a/sbin/isakmpd/pf_key_v2.c
+++ b/sbin/isakmpd/pf_key_v2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_key_v2.c,v 1.108 2002/06/10 20:54:51 ho Exp $ */
+/* $OpenBSD: pf_key_v2.c,v 1.109 2002/06/11 18:04:28 ho Exp $ */
/* $EOM: pf_key_v2.c,v 1.79 2000/12/12 00:33:19 niklas Exp $ */
/*
@@ -779,7 +779,10 @@ pf_key_v2_get_spi (size_t *sz, u_int8_t proto, struct sockaddr *src,
goto cleanup;
/* XXX This is ugly. */
if (proto == IPSEC_PROTO_IPCOMP)
- *(u_int16_t *)spi = (u_int16_t)sa->sadb_sa_spi;
+ {
+ u_int32_t tspi = ntohl (sa->sadb_sa_spi);
+ *(u_int16_t *)spi = htons ((u_int16_t)tspi);
+ }
else
memcpy (spi, &sa->sadb_sa_spi, *sz);