From patchwork Fri Sep 12 13:22:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 4411 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:b149:b0:671:5a2c:6455 with SMTP id s9csp3803767maw; Fri, 12 Sep 2025 06:22:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWoNsLzzzoK0OLKwz3M8IwJ8i16gyqvFKXAig+8jWFo0yi/cIDEEzrPb4OrtU7QNCgJQYffpjSDpQQ=@openvpn.net X-Google-Smtp-Source: AGHT+IEUPZnvCBjynyrfwpWIYsj3XGWMkXMxGz54+B6f1MwEdwbBGMucde8J0ltpoZ1ebqlhcFhd X-Received: by 2002:a05:6871:2002:b0:30b:beb3:5420 with SMTP id 586e51a60fabf-32e5457b918mr1216392fac.17.1757683375289; Fri, 12 Sep 2025 06:22:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1757683375; cv=none; d=google.com; s=arc-20240605; b=bpg49Aevn/s+lPoSuj83r4+y3OJjW5g6VxI60LHitgK3izmxw4b6r3OQJ9wEMFF+9j hIFefFDoQxa4+rpYdFDX1K50FUYEWk3679hk3uVj70i9Wzhiu0/1yYDo+pc+NFX8zg8I WfX4uBs6fJv7I4zhouOoIrWjqJumdb6ZiDd5iln08OxqlBZc7RwVR/zxEBZR9W3udX6V UEtNkzXFtYj5tWIBKhGs3xyncDPnutPRyTGrU1PLLj/NjjvNkyb4cWkh7TZ52hPYhSPJ CtdG2oVy9K7x3g8cWG+jCv+toPVj9j6Q4ibr7QW/RxgOprPmdk8zislzra0RfGjospEx zHyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:cc: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:dkim-signature; bh=nWpI8OM9z5F6QTtT5QomYnEXtI1mcJ1+f5QRZsNuuTk=; fh=ZRBZ3p4fvLYBwsG7McdxRCx2fnmH9YCsPK+JAqT+6LA=; b=EddwYWapH9QmI5BqFgiNqPLiaAPvi0s5cJm7t9VSFs0aNHcEqf+en08GGICu3DJoZw WfM29Di7akiFoIIfQF1spkBkme/Mzz38qYaELWNHmiyL5FAovrVtrBXPgNtitbQGDYS2 aNRTV1xKUEEemb3S+NR2RpolfWgmStS0v0miM/K8/rqjrcgeQsIR0OFSLh14uzDowQwX jlpXXdjlvUr+Ly6/PMMfE4rCJjlQok0d+nO8BX7IKNQWpdhud/wNfByWPNwrEQrYOxP3 qqK5QzyBzBzbZBavJzij+IOLGgvhxhUADHte4466dQPlYM3/4Wy+AdT2GNKurbjPUq2V T1Fw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=McK8dxgb; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=ZW3tJQWK; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=ACQx3P8f; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=mQm+Yp8A; 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 Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-32d32f47f1esi1110693fac.21.2025.09.12.06.22.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Sep 2025 06:22:55 -0700 (PDT) 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=McK8dxgb; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=ZW3tJQWK; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=ACQx3P8f; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=mQm+Yp8A; 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 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:Cc: 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:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nWpI8OM9z5F6QTtT5QomYnEXtI1mcJ1+f5QRZsNuuTk=; b=McK8dxgb2pxd5FJpli/S8zvIEs omGQf+4qPl+h2trSKTl9+uzx7PaDKPWS5JLanVVt4uatxu0mqMJbfSCN8+ndfP25FCq3U0a4ub5nA iQX0GxbEiWPtdYpiOxodHi3C2wXkdWO6537JpveUrvGpCTHXVJNba4RgY10Y75vkLZeg=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1ux3jp-0002nl-6g; Fri, 12 Sep 2025 13:22:53 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1ux3jn-0002nd-2A for openvpn-devel@lists.sourceforge.net; Fri, 12 Sep 2025 13:22:51 +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=CNBXLVEmlbmtkO8bY/GJr5P7tZzo7yCkLeJt80mMgH4=; b=ZW3tJQWKCp9POd3RsNZrFHtjRO HcyMMUzqhwh6FlWCSMJ3aAdOyF3odF3FmU3Kexi7lOZwo0Dt+sEhHghpMbhG9BWNNqGxyXrR0IDam AEabWq5V5Fpb2jQ0J2jG8575Z3zNhNvkoJn1UKWlSeJ7zyqOdzjljbkhMWrfE3WH0B1c=; 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=CNBXLVEmlbmtkO8bY/GJr5P7tZzo7yCkLeJt80mMgH4=; b=ACQx3P8fMRfXax0vHE6mC+BMzI OfFBJ+R4CkEEl33kJ4xxVJkFSAtfaWHx5SunDR4VAlUTB4Wjm5ngyFqquVteqBghfwdUw1OT5Xbo8 hKy7FoWr1/d7gwb6XdlcF04sMTO+/ovofT3TGH2HFm6nYut0jwbJ8o7Cc7ysHueLXZZY=; Received: from mout-p-102.mailbox.org ([80.241.56.152]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1ux3jm-0001Lt-Ee for openvpn-devel@lists.sourceforge.net; Fri, 12 Sep 2025 13:22:50 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4cNZq100dkz9sqZ; Fri, 12 Sep 2025 15:22:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1757683357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CNBXLVEmlbmtkO8bY/GJr5P7tZzo7yCkLeJt80mMgH4=; b=mQm+Yp8Ay4Mghm4gSNEG8rKCYh3LYiwpfe3mJvd79klzKsp8zSyJp24e/spoKhcBuESZ9Z jR+fsv+Qcqbg8SZ5/t3xt8Ohtgv1QsgaveiWPyUG8qcahlmyN43eWFF4zMediRIfrlzCVP g9aEehDNJ74upqyEb2QZsQcAB+zQUr1pIDBYQuIJtvognQPj2gs1L5oyH55152rRRMUCZ3 sxOqTgzFdpdQj9Uga0S+JaJSYqkCLN0f53jG8ZsY05Cdr68eBDkXwYzwGhnh4lE/laBttw FwdtqdqiOOlFzXwELwcj0Y/mG/x3lqoA6WDsmtg9yIboX9d4G8GS88WS1eAS1w== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Fri, 12 Sep 2025 15:22:35 +0200 Message-Id: <20250912132235.44304-1-frank@lichtenheld.com> In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.2 (/) 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: Lev Stipakov Commit 2dfc4f8 ("dns: deal with --dhcp-options when --dns is active") Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-Headers-End: 1ux3jm-0001Lt-Ee Subject: [Openvpn-devel] [PATCH v1] Preserve --dhcp-option values from local config 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: , Cc: Lev Stipakov Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1843064602853471830?= X-GMAIL-MSGID: =?utf-8?q?1843064602853471830?= From: Lev Stipakov Commit 2dfc4f8 ("dns: deal with --dhcp-options when --dns is active") has changed the way how --dhcp-option values are stored. Instead of storing them directly in tuntap_options, they are now stored in dns_options->from_dhcp. Before connect, we save options before --pull is applied, for that we call clone_dns_options(). However, this routing was missing cloning of from_dhcp struct, and as a result, the values of --dhcp-option from' the local config have been lost. Fix by adding shallow-copying of dhcp_options to clone_dns_options(). It is safe to do because it only contains fixed-size arrays, scalar types and pointers to the strings which this struct doesn't own. GitHub: https://github.com/OpenVPN/openvpn/issues/839 Change-Id: I815e68dd5d365743faff2b80783b776d9e8a645c Signed-off-by: Lev Stipakov Acked-by: Frank Lichtenheld --- 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/+/1181 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpn/dns.c b/src/openvpn/dns.c index 8554089..5421004 100644 --- a/src/openvpn/dns.c +++ b/src/openvpn/dns.c @@ -264,6 +264,7 @@ clone.servers_prepull = clone_dns_servers(o->servers_prepull, gc); clone.updown = o->updown; clone.updown_flags = o->updown_flags; + clone.from_dhcp = o->from_dhcp; return clone; }