summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authortobhe <tobhe@cvs.openbsd.org>2020-11-06 20:39:55 +0000
committertobhe <tobhe@cvs.openbsd.org>2020-11-06 20:39:55 +0000
commit463231400efe2176927b833ad9f1ae7285d7e891 (patch)
tree63920e822c9695aa8eb01ad1583027cb1090f5c9 /sbin
parent76b02c4b9ca77efc5f3751373baa55812e467f7a (diff)
Set correct netmask on patched addresses for debug printing.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/iked/ikev2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/iked/ikev2.c b/sbin/iked/ikev2.c
index dd827f94ae6..38503d79872 100644
--- a/sbin/iked/ikev2.c
+++ b/sbin/iked/ikev2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ikev2.c,v 1.275 2020/10/30 23:32:42 tobhe Exp $ */
+/* $OpenBSD: ikev2.c,v 1.276 2020/11/06 20:39:54 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
@@ -6759,6 +6759,8 @@ ikev2_cp_fixaddr(struct iked_sa *sa, struct iked_addr *addr,
if (in4->sin_addr.s_addr)
return (-1);
memcpy(patched, sa->sa_addrpool, sizeof(*patched));
+ patched->addr_net = 0;
+ patched->addr_mask = 32;
break;
case AF_INET6:
if (sa->sa_addrpool6 == NULL)
@@ -6767,6 +6769,8 @@ ikev2_cp_fixaddr(struct iked_sa *sa, struct iked_addr *addr,
if (!IN6_IS_ADDR_UNSPECIFIED(&in6->sin6_addr))
return (-1);
memcpy(patched, sa->sa_addrpool6, sizeof(*patched));
+ patched->addr_net = 0;
+ patched->addr_mask = 128;
break;
}
return (0);