From 41bfefafaa6474a8d1aa2961049bfdf42e0ab299 Mon Sep 17 00:00:00 2001 From: tobhe Date: Thu, 13 Aug 2020 21:36:39 +0000 Subject: Properly set flow_saproto for aquire. ok patrick@ --- sbin/iked/pfkey.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'sbin') diff --git a/sbin/iked/pfkey.c b/sbin/iked/pfkey.c index 202e3a374d0..9ac87ebf738 100644 --- a/sbin/iked/pfkey.c +++ b/sbin/iked/pfkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkey.c,v 1.68 2020/07/21 08:03:39 tobhe Exp $ */ +/* $OpenBSD: pfkey.c,v 1.69 2020/08/13 21:36:38 tobhe Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter @@ -1895,6 +1895,18 @@ pfkey_process(struct iked *env, struct pfkey_message *pm) return (0); } + switch (hdr->sadb_msg_satype) { + case SADB_SATYPE_AH: + flow.flow_saproto = IKEV2_SAPROTO_AH; + break; + case SADB_SATYPE_ESP: + flow.flow_saproto = IKEV2_SAPROTO_ESP; + break; + case SADB_X_SATYPE_IPCOMP: + flow.flow_saproto = IKEV2_SAPROTO_IPCOMP; + break; + } + if ((sa_proto = pfkey_find_ext(reply, rlen, SADB_X_EXT_FLOW_TYPE)) == NULL) { errmsg = "flow protocol"; -- cgit v1.2.3