summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2004-12-10 18:50:52 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2004-12-10 18:50:52 +0000
commitf59156eed73490984509b6924e12700fafae17f6 (patch)
tree763ccf46ccbc6e7c9dd3ce1f004773db3fb6b943 /sys/net
parentdd574af3eae7c8e23fb65c0f668c7a404e214845 (diff)
fix ipsec crash from pr 4025, Stefan Miltchev; ok hshoexer@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/pfkeyv2.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c
index dadea771785..2b3e56d64f5 100644
--- a/sys/net/pfkeyv2.c
+++ b/sys/net/pfkeyv2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkeyv2.c,v 1.95 2004/11/29 21:42:20 hshoexer Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.96 2004/12/10 18:50:51 markus Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
@@ -1822,6 +1822,11 @@ pfkeyv2_acquire(struct ipsec_policy *ipo, union sockaddr_union *gw,
if (ipo->ipo_dstid)
i += sizeof(struct sadb_ident) + PADUP(ipo->ipo_dstid->ref_len);
+ if (ipo->ipo_local_cred)
+ i += sizeof(struct sadb_x_cred) + PADUP(ipo->ipo_local_cred->ref_len);
+
+ if (ipo->ipo_local_auth)
+ i += sizeof(struct sadb_x_cred) + PADUP(ipo->ipo_local_auth->ref_len);
/* Allocate */
if (!(p = malloc(i, M_PFKEY, M_DONTWAIT))) {
@@ -2040,7 +2045,7 @@ pfkeyv2_acquire(struct ipsec_policy *ipo, union sockaddr_union *gw,
sadb_comb++;
}
- /* Send the ACQUIRE message to all compliant registered listeners. */
+ /* Send the ACQUIRE message to all compliant registered listeners. */
if ((rval = pfkeyv2_sendmessage(headers,
PFKEYV2_SENDMESSAGE_REGISTERED, NULL, smsg->sadb_msg_satype, 0))
!= 0)