summaryrefslogtreecommitdiff
path: root/sys/net/pfkeyv2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/pfkeyv2.c')
-rw-r--r--sys/net/pfkeyv2.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c
index 136fa2899f4..9a593f8d663 100644
--- a/sys/net/pfkeyv2.c
+++ b/sys/net/pfkeyv2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkeyv2.c,v 1.64 2001/06/05 02:31:34 deraadt Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.65 2001/06/07 05:27:52 angelos Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
@@ -1147,6 +1147,18 @@ pfkeyv2_get(struct tdb *sa, void **headers, void **buffer)
if (sa->tdb_dstid)
i += PADUP(sa->tdb_dstid->ref_len) + sizeof(struct sadb_ident);
+ if (sa->tdb_local_cred)
+ i += PADUP(sa->tdb_local_cred->ref_len) + sizeof(struct sadb_x_cred);
+
+ if (sa->tdb_remote_cred)
+ i += PADUP(sa->tdb_remote_cred->ref_len) + sizeof(struct sadb_x_cred);
+
+ if (sa->tdb_local_auth)
+ i += PADUP(sa->tdb_local_auth->ref_len) + sizeof(struct sadb_x_cred);
+
+ if (sa->tdb_remote_auth)
+ i += PADUP(sa->tdb_remote_auth->ref_len) + sizeof(struct sadb_x_cred);
+
if (!(p = malloc(i, M_PFKEY, M_DONTWAIT)))
{
rval = ENOMEM;