From patchwork Wed Sep 23 20:44:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kristof Provost via Openvpn-devel X-Patchwork-Id: 1475 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id sNLeKj5DbF9rSgAAIUCqbw (envelope-from ) for ; Thu, 24 Sep 2020 02:57:02 -0400 Received: from proxy5.mail.iad3b.rsapps.net ([172.31.255.6]) by director9.mail.ord1d.rsapps.net with LMTP id YNW9Kj5DbF+9dAAAalYnBA (envelope-from ) for ; Thu, 24 Sep 2020 02:57:02 -0400 Received: from smtp36.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy5.mail.iad3b.rsapps.net with LMTPS id KCK6Iz5DbF+qYgAA13hMnw (envelope-from ) for ; Thu, 24 Sep 2020 02:57:02 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp36.gate.iad3b.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=pass header.d=lists.sourceforge.net; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=pass (p=none; dis=none) header.from=lists.sourceforge.net X-Suspicious-Flag: NO X-Classification-ID: 25a81a54-fe33-11ea-ab05-5254003a7283-1-1 Received: from [216.105.38.7] ([216.105.38.7:45678] helo=lists.sourceforge.net) by smtp36.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 9B/AD-21127-E334C6F5; Thu, 24 Sep 2020 02:57:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:To:Sender:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QhEq00PeZi7QuI64GZufa7RZuAUpXxvrHSRSa6Oly6E=; b=iXK1l5JCK9JBBAQ0xlPC7rSAw 5T/ri6Mx/kLn/IV8agmEN5nqKcns9E452E0XVLU0th4SSTSiQWTkojKE5kd6/d1ToMdeS0BHIUeqF qbfc7Kfk3u8fFMM0nWnX2rwaycOPOp5keFjgJGeGwUO9dEiVfH61DAr4La1zxzJIPrBfg=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLAs-0007PF-Ka; Thu, 24 Sep 2020 06:56:14 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLLAr-0007P3-D1 for openvpn-devel@lists.sourceforge.net; Thu, 24 Sep 2020 06:56:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9y7cUumnwOx38vRA1IDnjBkaykJmRJz5oMDkc+MEFGk=; b=UUTYOsUni60AGnaNEQmFgERFQy P1GBHPmD6R8JR50wCWfe5TBAJUpxzyYepbDR5WRBheBs1Hce0PZbAEHfgzYcpCTtTlhX0UnbI82Vb O8ulFSnPo/c7e1Ueqh6eZQ0QB4A2wgRn//qQLpQooyeHdTO+BxQWnZEJk/UeyKaAmy1s=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9y7cUumnwOx38vRA1IDnjBkaykJmRJz5oMDkc+MEFGk=; b=ZhGlaWsyo4iOihfqzIbf4U7dlX uncntpCr16jH6KQVuSHYxrf5yg531aJnEtl1HYTzquSlOmJtCuEyqUSWsT4kNOBecCOJ9dgJB6mQU JXNPKsNYegDJXB3pmN9gyyBGk4+Wf+kYpuw+OFJuaqiZGRCG0MF/ZFIpA/GwDVfoSdjA=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1kLLAd-003ZLg-2y for openvpn-devel@lists.sourceforge.net; Thu, 24 Sep 2020 06:56:12 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id 640A51002F9B; Thu, 24 Sep 2020 08:45:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1600929907; bh=9y7cUumnwOx38vRA1IDnjBkaykJmRJz5oMDkc+MEFGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p6row96vBcUBZGTqlGe/FfN526BDE0yYYOWZzwWrFE54ocG63P04Va7cPgnuBaxNi Il0COwoWr05Wsj2yclnm2FF+IMCNfhICjGSD1WDzEL0pnLJXFe4y5PtOUSVdcTgQXu wEHYFnPMCLUB+7aa4Q9Z2SIazZ4z85KSkmT9/QJM= X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on brana.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:8103:4a53:d5f0:1d48]) by pub5.amebis.si (Postfix) with ESMTP id 223661002F9B; Thu, 24 Sep 2020 08:45:05 +0200 (CEST) To: openvpn-devel@lists.sourceforge.net Date: Thu, 24 Sep 2020 08:44:51 +0200 Message-Id: <20200924064452.1001-2-simon@rozman.si> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200924064452.1001-1-simon@rozman.si> References: <20200924064452.1001-1-simon@rozman.si> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rozman.si] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1kLLAd-003ZLg-2y Subject: [Openvpn-devel] [PATCH 2/3] netsh: Clear existing IPv6 DNS servers before configuring new ones X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Simon Rozman via Openvpn-devel From: Kristof Provost via Openvpn-devel Reply-To: Simon Rozman Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox When there are no IPv6 DNS published, the adapter state is not sanitized and might contain IPv6 DNS server from a previous session. netsh_ifconfig_options() clears DNS servers for IPv4 already. Signed-off-by: Simon Rozman Acked-by: Lev Stipakov Acked-by: Lev Stipakov <lstipakov@gmail.com>
--- src/openvpn/tun.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 8fd3229f..b1cd7a1b 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -5281,7 +5281,6 @@ ip_addr_member_of(const in_addr_t addr, const IP_ADDR_STRING *ias) * Set the ipv6 dns servers on the specified interface. * The list of dns servers currently set on the interface * are cleared first. - * No action is taken if number of addresses (addr_len) < 1. */ static void netsh_set_dns6_servers(const struct in6_addr *addr_list, @@ -5291,6 +5290,13 @@ netsh_set_dns6_servers(const struct in6_addr *addr_list, struct gc_arena gc = gc_new(); struct argv argv = argv_new(); + /* delete existing DNS settings from TAP interface */ + argv_printf(&argv, "%s%s interface ipv6 delete dns %lu all", + get_win_sys_path(), + NETSH_PATH_SUFFIX, + adapter_index); + netsh_command(&argv, 2, M_FATAL); + for (int i = 0; i < addr_len; ++i) { const char *fmt = (i == 0) ?