From patchwork Tue Dec 15 06:30:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Domagoj Pensa X-Patchwork-Id: 1551 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id +N6aC/3y2F95WgAAIUCqbw (envelope-from ) for ; Tue, 15 Dec 2020 12:31:41 -0500 Received: from proxy8.mail.ord1d.rsapps.net ([172.30.191.6]) by director10.mail.ord1d.rsapps.net with LMTP id EHUuC/3y2F9lLgAApN4f7A (envelope-from ) for ; Tue, 15 Dec 2020 12:31:41 -0500 Received: from smtp9.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy8.mail.ord1d.rsapps.net with LMTPS id EB7+Cv3y2F8VOAAAGdz6CA (envelope-from ) for ; Tue, 15 Dec 2020 12:31:41 -0500 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: smtp9.gate.ord1d.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=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=pensa.hr X-Suspicious-Flag: YES X-Classification-ID: 63c9d6fc-3efb-11eb-b2c6-525400bd3b1f-1-1 Received: from [216.105.38.7] ([216.105.38.7:53072] helo=lists.sourceforge.net) by smtp9.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 11/D5-05275-CF2F8DF5; Tue, 15 Dec 2020 12:31:40 -0500 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 1kpE9z-0000bS-NU; Tue, 15 Dec 2020 17:30:51 +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 1kpE9g-0000ah-B9 for openvpn-devel@lists.sourceforge.net; Tue, 15 Dec 2020 17:30:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Date:Subject:Message-ID:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xAG99rm65PwGL+UDkQhrRFiesc9siU2oi4073CYCM0k=; b=Rf4UYUHH7+/c6x8tY0C6M5HuCC ok50+XeEPIzH5nQ9m0XY6j4gL/HdwtyrTjQl7IDKe92KhfskB6BLv5c8XIKcqRz7n2VGm+EUJGWhW 7VlG8M001JDNuN5l04p9lIgfCs3bRAjm18WJUa0vHh6H3yJU+gf906iAL7Yb0kx+ksTM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Date:Subject: Message-ID:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xAG99rm65PwGL+UDkQhrRFiesc9siU2oi4073CYCM0k=; b=T2S9xHXMen8K8NhXRyLEn6RVlt BW9FAQMLPZMdFqjX/l7y8lV6aT9UlmbwD6TGARR75qgXdl+Ozv6n8TGqPtj5KeBq99QnD011WaSGa w8lKjECC4qoTY0xNq2uejvFvmAsO2v5RJDYtmDchIYCmmXmkbIVpODFk13uUZL67QxCE=; Received: from sender4-of-o50.zoho.com ([136.143.188.50]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1kpE9S-00EYVi-Mx for openvpn-devel@lists.sourceforge.net; Tue, 15 Dec 2020 17:30:32 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1608053409; cv=none; d=zohomail.com; s=zohoarc; b=JUDn8V8yy8hMRQN6VDnZVajdA0xBoz9ii8bUIRC4u+efb/feHWkGEM6ObYnkDO1nf146rhhXJH1g5XuC9QX7n4SMY85RObD6nrtGRqundvS/TxAyQboq9xKdEl3Jj7B2XTCeTyarx4rBkEqcK/0EhONoN5KkkKn5TcFmnQVK9Sk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608053409; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=xAG99rm65PwGL+UDkQhrRFiesc9siU2oi4073CYCM0k=; b=A57ri3xWRbGlyqUyxYh1D/Z3UZcLzFJPDaYMLQZlCTzPCzdAtf4MMTLGSNDK+ZbREyQyPllfvfhl6nQcWaiIrIay2JyTbEHZ/H/ZlBdzZWfPmkmxRWtK3WyU9+KIlrUtwab6PQBnxMctOy8s7jDKA3N5NfX5YE+WcotuwPE+jS4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass smtp.mailfrom=domagoj@pensa.hr; dmarc=pass header.from= header.from= Received: from localhost (21-233.dsl.iskon.hr [89.164.21.233]) by mx.zohomail.com with SMTPS id 1608053407124756.0305245805769; Tue, 15 Dec 2020 09:30:07 -0800 (PST) From: Domagoj Pensa To: openvpn-devel@lists.sourceforge.net Message-ID: <20201215173004.26170-1-domagoj@pensa.hr> Date: Tue, 15 Dec 2020 18:30:04 +0100 X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [136.143.188.50 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [136.143.188.50 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Headers-End: 1kpE9S-00EYVi-Mx Subject: [Openvpn-devel] [PATCH] Skip DHCP renew with Wintun adapter 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: Domagoj Pensa Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Wintun does not support DHCP. Running DHCP renew with Wintun adapter fails with a logged warning. Fixed so that DHCP renewing is called only for TAP-Windows6 adapters. Acked-by: Lev Stipakov --- src/openvpn/tun.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 400a50ca..6892fdb7 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -6155,35 +6155,35 @@ tuntap_set_ip_addr(struct tuntap *tt, status, strerror_win32(status, &gc)); } - } - /* - * If the TAP-Windows driver is masquerading as a DHCP server - * make sure the TCP/IP properties for the adapter are - * set correctly. - */ - if (dhcp_masq_post) - { - /* check dhcp enable status */ - if (dhcp_status(index) == DHCP_STATUS_DISABLED) + /* + * If the TAP-Windows driver is masquerading as a DHCP server + * make sure the TCP/IP properties for the adapter are + * set correctly. + */ + if (dhcp_masq_post) { - msg(M_WARN, "WARNING: You have selected '--ip-win32 dynamic', which will not work unless the TAP-Windows TCP/IP properties are set to 'Obtain an IP address automatically'"); - } + /* check dhcp enable status */ + if (dhcp_status(index) == DHCP_STATUS_DISABLED) + { + msg(M_WARN, "WARNING: You have selected '--ip-win32 dynamic', which will not work unless the TAP-Windows TCP/IP properties are set to 'Obtain an IP address automatically'"); + } - /* force an explicit DHCP lease renewal on TAP adapter? */ - if (tt->options.dhcp_pre_release) - { - dhcp_release(tt); + /* force an explicit DHCP lease renewal on TAP adapter? */ + if (tt->options.dhcp_pre_release) + { + dhcp_release(tt); + } + if (tt->options.dhcp_renew) + { + dhcp_renew(tt); + } } - if (tt->options.dhcp_renew) + else { - dhcp_renew(tt); + fork_dhcp_action(tt); } } - else - { - fork_dhcp_action(tt); - } if (tt->did_ifconfig_setup && tt->options.ip_win32_type == IPW32_SET_IPAPI) {