From 73d6dc34cbeaee5f26156a444d405c98ba5510d1 Mon Sep 17 00:00:00 2001 From: tobhe Date: Mon, 18 Jul 2022 19:32:16 +0000 Subject: [PATCH] Check if there is a locally cached nameserver to send before responding to RTP_PROPOSAL_SOLICIT. Fixes a crash when resolvd is restarted but no name server is set. --- sbin/iked/vroute.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sbin/iked/vroute.c b/sbin/iked/vroute.c index 328b0be7976..89a7f01cc5e 100644 --- a/sbin/iked/vroute.c +++ b/sbin/iked/vroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vroute.c,v 1.16 2022/03/16 18:17:20 tobhe Exp $ */ +/* $OpenBSD: vroute.c,v 1.17 2022/07/18 19:32:16 tobhe Exp $ */ /* * Copyright (c) 2021 Tobias Heider @@ -133,7 +133,8 @@ vroute_rtmsg_cb(int fd, short events, void *arg) switch(rtm->rtm_type) { case RTM_PROPOSAL: - if (rtm->rtm_priority == RTP_PROPOSAL_SOLICIT) { + if (rtm->rtm_priority == RTP_PROPOSAL_SOLICIT && + ivr->ivr_dns) { log_debug("%s: got solicit", __func__); vroute_dodns(env, (struct sockaddr *)&ivr->ivr_dns->vd_addr, 1, ivr->ivr_dns->vd_ifidx); -- 2.20.1