summaryrefslogtreecommitdiff
path: root/sbin/iked/ikev2.c
diff options
context:
space:
mode:
authortobhe <tobhe@cvs.openbsd.org>2021-05-31 17:10:15 +0000
committertobhe <tobhe@cvs.openbsd.org>2021-05-31 17:10:15 +0000
commit3d0d9a2135f7b041c1856f2be74679d309f0ba01 (patch)
tree0a1cb26da216b5341b83aabd186d79b68fa9ea8a /sbin/iked/ikev2.c
parentfb966f6d8477e955bddc4ef62efbfac3b5732008 (diff)
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@
Diffstat (limited to 'sbin/iked/ikev2.c')
-rw-r--r--sbin/iked/ikev2.c6
1 files 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 <tobias.heider@stusta.de>
@@ -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);