From e249fa472dde43f3918a1b48ce1ac4fe4cd422cf Mon Sep 17 00:00:00 2001 From: tobhe Date: Mon, 31 May 2021 17:10:14 +0000 Subject: [PATCH] Don't fail hard in ikev2_cp_fixaddr() if no address pool is found. Fixes a bug where no flows are loaded when a single config address without pool is configured. ok patrick@ --- sbin/iked/ikev2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/iked/ikev2.c b/sbin/iked/ikev2.c index 6c6a374b156..276391a465f 100644 --- a/sbin/iked/ikev2.c +++ b/sbin/iked/ikev2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ikev2.c,v 1.321 2021/05/31 16:54:45 tobhe Exp $ */ +/* $OpenBSD: ikev2.c,v 1.322 2021/05/31 17:10:14 tobhe Exp $ */ /* * Copyright (c) 2019 Tobias Heider @@ -7066,7 +7066,7 @@ ikev2_cp_fixaddr(struct iked_sa *sa, struct iked_addr *addr, naddr = (sa->sa_cp == IKEV2_CP_REQUEST) ? sa->sa_addrpool : sa->sa_cp_addr; if (naddr == NULL) - return (-1); + return (-2); in4 = (struct sockaddr_in *)&addr->addr; if (in4->sin_addr.s_addr) return (-2); @@ -7078,7 +7078,7 @@ ikev2_cp_fixaddr(struct iked_sa *sa, struct iked_addr *addr, naddr = (sa->sa_cp == IKEV2_CP_REQUEST) ? sa->sa_addrpool6 : sa->sa_cp_addr6; if (naddr == NULL) - return (-1); + return (-2); in6 = (struct sockaddr_in6 *)&addr->addr; if (!IN6_IS_ADDR_UNSPECIFIED(&in6->sin6_addr)) return (-2); -- 2.20.1