summaryrefslogtreecommitdiff
path: root/sbin/iked/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/iked/config.c')
-rw-r--r--sbin/iked/config.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/iked/config.c b/sbin/iked/config.c
index 987f5f24b2e..5c33685bbb9 100644
--- a/sbin/iked/config.c
+++ b/sbin/iked/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.27 2014/04/22 12:00:03 reyk Exp $ */
+/* $OpenBSD: config.c,v 1.28 2014/05/06 07:24:37 markus Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -339,7 +339,8 @@ config_add_transform(struct iked_proposal *prop, u_int type,
}
struct iked_transform *
-config_findtransform(struct iked_proposals *props, u_int8_t type)
+config_findtransform(struct iked_proposals *props, u_int8_t type,
+ u_int proto)
{
struct iked_proposal *prop;
struct iked_transform *xform;
@@ -347,6 +348,9 @@ config_findtransform(struct iked_proposals *props, u_int8_t type)
/* Search of the first transform with the desired type */
TAILQ_FOREACH(prop, props, prop_entry) {
+ /* Find any proposal or only selected SA proto */
+ if (proto != 0 && prop->prop_protoid != proto)
+ continue;
for (i = 0; i < prop->prop_nxforms; i++) {
xform = prop->prop_xforms + i;
if (xform->xform_type == type)