From patchwork Tue Nov 3 18:44:45 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5582 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:4121:b0:118:2077:975e with SMTP id d33csp1040010laa; Tue, 3 Nov 2026 10:45:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvBwGE3kgcn2Uns1p5NWw9AIxQJrP3yDUmhagfDy5sW4ytoTxWDMS05gFfj3CWo6LGz4uq/EOJXpAnCk=@openvpn.net X-Received: by 2002:a05:7301:4306:b0:369:44b3:99c0 with SMTP id 5a478bee46e88-36a42340c9bmr19834809eec.8.1793731506086; Tue, 03 Nov 2026 10:45:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793731506; cv=none; d=google.com; s=arc-20260327; b=Asigp8nhQbUocLiRqhYhPCRtCBxyFeYuQPiFHFlwVrVl4TitBkKthne2xfAaaYqhw9 yj9mTvc6R6qnBGk2AsSonuIpGYx+8dNUJpkIKNUF1Nuk+SfzzcBS054BWK7FdGgySkjD ZqpvJkgnkH2/RAvJRKHB/VErOZvEyWkELkTxmUFnKsAPKTjMRIyCjUt5RJlStTTvZKlB Mh7MkdkoQATOgHkhBw0ghOSrIqzXbXgk4cifzpaxX2yCWb1W/F708ip0E+eAsfdj/Zpk DIg6ZcOdvxjHd5CXxlYhQxDB9fOkmXLMYEU9xjiHe+vGxw7g08zLHuJ3fDTjuO5/HjYn 6VlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=9sjIgT6N2X6/lyE7pO/5mbBNkjWyaxyZ3JRzRHXukmA=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=SjVZ/tAc3HWih0iZGp8P6AgsxhnwJMEvLsm5mvk5939e3PGXAuiRg/opKVx1N3pGNb Wc8p0YEZ/ZcyfyVjT3UWAHSbG+SDGxiBVEFsAvxmAMcQ0msrLMzhe2/L/DSidNh4Xptw 4XIN1LdnSTWtB4XqyDC8jw5+bt20H9btQwWfrdyyZw3fQ301I+8mUE81IBlSBCoT6G+B ZomhlArAp8hZRBjPusJpCLsOH09CO9ZjhAmd821W99yuQfGlRDFvfGvJDti0p+5hcgfS MFmtU9toGWWpwyaiPrMjqTs97TTOQxjqWwTCHg7LS8QfE2uUM2LzBTClL963zLFZYGmM Sz2g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=GLaTYFh+; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=KhP5Et2k; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=i1kopoJk; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 5a478bee46e88-36ca39c602esi8601eec.79.2026.11.03.10.45.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Nov 2026 10:45:06 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=GLaTYFh+; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=KhP5Et2k; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=i1kopoJk; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de 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: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=9sjIgT6N2X6/lyE7pO/5mbBNkjWyaxyZ3JRzRHXukmA=; b=GLaTYFh+e2BFS3 h3rSB0VTlSKAqIJCk0wjwp+TX+OBt0S5ATLuoVuig86ysJbpdca7aC4/sXIRh6OLBbJTYlexP+JZ7 mqhPHuAw9tyWlZ1I1gi1p+0nzCmmz/lVUIK38Qd+bB2d/sNjeEQAlvrTZ3X1f+J2v3/3wpnE8WEiD mQA=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.100.1) (envelope-from ) id 1xOJVI-000000006Kz-3Xu0; Tue, 03 Nov 2026 18:45:04 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xOJVH-000000006Ko-1rHj for openvpn-devel@lists.sourceforge.net; Tue, 03 Nov 2026 18:45:03 +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:To:From:Sender:Reply-To:Cc: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-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dtDMVTi21q0zRHqIhyq8vwIBsNAeIyN0f2MLDv6U6oU=; b=KhP5Et2kQ9W8ZkqUrnGd2sDm7S 7shWUWcdT/pWy2tRtid5JQNaZtDU/3gF1hgDCDEHzyeNyKInY08NGFQSlqDT/kIRhMD7kXWDIlEFx PEpd1kFZ30ZZvvOgU3p8v5DPyDoAJlyNuK+JRzp6pwQ6JDaUJeMQVF2L7/xcjO+UZSMI=; 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:To:From:Sender:Reply-To:Cc: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-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=dtDMVTi21q0zRHqIhyq8vwIBsNAeIyN0f2MLDv6U6oU=; b=i1kopoJk2NjQSezGUxfQJng+5D yWV+iNW+F2Gnj7ZOUap9aivh+J84y8r7p+Eg5ZilrQ+TO4aeTSHo5itcxJHb/JSV9B+l5OlHq8ROW POeYT0d+Oko0LQOcC+EANyYAlQXvgSm7uPkDBzMJ8C2g83j7R+3tz5SeY4yoZa2bjtH0=; Received: from [193.149.48.129] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xOJVE-000000005CH-2Mwg for openvpn-devel@lists.sourceforge.net; Tue, 03 Nov 2026 18:45:03 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 6A3Iirog009567 for ; Tue, 3 Nov 2026 19:44:53 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6A3Iir3N009566 for openvpn-devel@lists.sourceforge.net; Tue, 3 Nov 2026 19:44:53 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 3 Nov 2026 19:44:45 +0100 Message-ID: <20261103184453.9550-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.55.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Razvan Cojocaru The RegGetValueA() result for DhcpNameServer was discarded and the error from the earlier NameServer lookup was tested instead. With no NameServer value, err was still ERROR_FILE_NOT_FOUND, so the DHC [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1xOJVE-000000005CH-2Mwg Subject: [Openvpn-devel] [PATCH v1] openvpnserv: check DhcpNameServer lookup in GetItfDnsServersV4() 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: 1880863807425483577 X-GMAIL-MSGID: 1880863807425483577 From: Razvan Cojocaru The RegGetValueA() result for DhcpNameServer was discarded and the error from the earlier NameServer lookup was tested instead. With no NameServer value, err was still ERROR_FILE_NOT_FOUND, so the DHCP fallback always failed. Broken since 0f3b7d17 ("win: implement --dns option support with NRPT"). Change-Id: I9eb4b74b53d680c160b8ac65ab844f6404431e62 Signed-off-by: Razvan Cojocaru Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2109 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2109 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 484f27c..4a8d0b5 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -2151,7 +2151,7 @@ if (!strchr(addrs, '.') && IsDhcpEnabled(itf_key)) { s = *size; - RegGetValueA(itf_key, NULL, "DhcpNameServer", RRF_RT_REG_SZ, NULL, (PBYTE)addrs, &s); + err = RegGetValueA(itf_key, NULL, "DhcpNameServer", RRF_RT_REG_SZ, NULL, (PBYTE)addrs, &s); if (err) { *size = 0;