diff options
author | tobhe <tobhe@cvs.openbsd.org> | 2020-11-14 20:14:08 +0000 |
---|---|---|
committer | tobhe <tobhe@cvs.openbsd.org> | 2020-11-14 20:14:08 +0000 |
commit | e17f4c71a8910e811e8ec410e0d44213185cc2c4 (patch) | |
tree | 21e813332cfd0be0391e6c4d521754d301fde874 /sbin/iked | |
parent | a58984e15896a74d168b2ca3ac09100dbf839ed1 (diff) |
Make sure not to replace 0.0.0.0 with dynamic address if it is a a network
address (addr_net is set).
Diffstat (limited to 'sbin/iked')
-rw-r--r-- | sbin/iked/ikev2.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/iked/ikev2.c b/sbin/iked/ikev2.c index f0f372d51e9..989cce5dd22 100644 --- a/sbin/iked/ikev2.c +++ b/sbin/iked/ikev2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ikev2.c,v 1.280 2020/11/13 21:09:49 tobhe Exp $ */ +/* $OpenBSD: ikev2.c,v 1.281 2020/11/14 20:14:07 tobhe Exp $ */ /* * Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de> @@ -6759,6 +6759,10 @@ ikev2_cp_fixaddr(struct iked_sa *sa, struct iked_addr *addr, struct sockaddr_in6 *in6; struct iked_addr *naddr; + if (addr->addr_net) + return (-1); + if (sa->sa_cp == 0) + return (-1); switch (addr->addr_af) { case AF_INET: naddr = (sa->sa_cp == IKEV2_CP_REQUEST) ? |