From 230b2070bb6f1dd42c93a1dcbc2ef5bc3f698480 Mon Sep 17 00:00:00 2001 From: Hakan Olsson Date: Tue, 11 Jun 2002 18:04:29 +0000 Subject: Stupid 16-bit CPI numbers. --- sbin/isakmpd/pf_key_v2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sbin/isakmpd') 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); -- cgit v1.2.3