summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobhe <tobhe@openbsd.org>2020-12-13 19:46:17 +0000
committertobhe <tobhe@openbsd.org>2020-12-13 19:46:17 +0000
commit35ead9fcfd7eefcfabfe7c5d3e6f3495137a0d81 (patch)
tree385254d25f8855303860b2e7f13b5297abd8c111
parentfix unmarked/ignored descriptive mix up; (diff)
downloadwireguard-openbsd-35ead9fcfd7eefcfabfe7c5d3e6f3495137a0d81.tar.xz
wireguard-openbsd-35ead9fcfd7eefcfabfe7c5d3e6f3495137a0d81.zip
Make sure flow src and dst addresses have the same address family.
ok patrick@
-rw-r--r--sbin/iked/parse.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/sbin/iked/parse.y b/sbin/iked/parse.y
index 18114871ddb..c42775a31ea 100644
--- a/sbin/iked/parse.y
+++ b/sbin/iked/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.119 2020/12/10 10:14:31 tobhe Exp $ */
+/* $OpenBSD: parse.y,v 1.120 2020/12/13 19:46:17 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
@@ -3011,6 +3011,11 @@ create_ike(char *name, int af, uint8_t ipproto,
for (ipa = hosts->src, ipb = hosts->dst; ipa && ipb;
ipa = ipa->next, ipb = ipb->next) {
+ if (ipa->af != ipb->af) {
+ yyerror("cannot mix different address families.");
+ goto done;
+ }
+
if ((flow = calloc(1, sizeof(struct iked_flow))) == NULL)
fatalx("%s: failed to alloc flow.", __func__);