From patchwork Tue Nov 12 23:06:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Yan X-Patchwork-Id: 916 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id +DauNibWy131SAAAIUCqbw for ; Wed, 13 Nov 2019 05:08:38 -0500 Received: from proxy17.mail.iad3b.rsapps.net ([172.31.255.6]) by director10.mail.ord1d.rsapps.net with LMTP id YKsLNCbWy11DfQAApN4f7A ; Wed, 13 Nov 2019 05:08:38 -0500 Received: from smtp1.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy17.mail.iad3b.rsapps.net with LMTP id OLBSLibWy12qAgAA5ccGVQ ; Wed, 13 Nov 2019 05:08:38 -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: smtp1.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=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: 8f631aae-05fd-11ea-958c-5254008fd675-1-1 Received: from [216.105.38.7] ([216.105.38.7:49148] helo=lists.sourceforge.net) by smtp1.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 9D/52-17643-626DBCD5; Wed, 13 Nov 2019 05:08:38 -0500 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1iUpYs-0007kK-HG; Wed, 13 Nov 2019 10:07:42 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iUpYr-0007kB-7x for openvpn-devel@lists.sourceforge.net; Wed, 13 Nov 2019 10:07:41 +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=ibhe8iagioaka1tzM2AZbdnHvwqyJt+yiFETq3dp4fk=; b=NZefiT0OKkPj/g9U1MadxSbC7U jYeHY5c6Tz5LfkwPIMUr6HWgwaIzaeJnkbRp2YasXqL17kqwYnLaAuC/rsqFTp752qGqnOGcnSe6h 5QcoixJGWMlw8laI6mpDw1OH0WmVmuX1x+52rq/Q3FWpestVQBxxBSr5FmpIF7bcWMDQ=; 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=ibhe8iagioaka1tzM2AZbdnHvwqyJt+yiFETq3dp4fk=; b=ZCi035W2O6XxAZiaQ3hBTZfNhH TaQh1BW79TYcaeq3J7pMiPfMjVVIB3tCZ9GqHCd1D5TaKwLcTgBuJioG4EjclE1lyLxVYk6559nZN 4lRkO6lSVm3G/ADaRflf2+b4y6ZSuLkyzDrsPZ2EjQvVppQ1k/CwUEZ27gfZipnx4BQ4=; Received: from mail-pl1-f180.google.com ([209.85.214.180]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1iUpYp-00ExYh-Kc for openvpn-devel@lists.sourceforge.net; Wed, 13 Nov 2019 10:07:41 +0000 Received: by mail-pl1-f180.google.com with SMTP id w8so868519plq.5 for ; Wed, 13 Nov 2019 02:07:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ibhe8iagioaka1tzM2AZbdnHvwqyJt+yiFETq3dp4fk=; b=Oqhi5Gm4WMrV+sdPEpwtzy3tRgNkwUuGAOLx4mnvGPUZHeDSvNfWvpqbxP+XAEdUdW 7CMW1KKyfHw4tYuug70BYSuXfJXknLLB/Fm7urvcZvjDRNZGFfieilxF8QkpCUhgFwG4 6zfvWkMeeyCEnkJDhxSjxTAwsrohK6nK4Y87ekNach4mPTZzHF63lduCFHfsLF1LsySp 4Zeo39tJrU9TQojgpQng9ksckchUFbHkfTFW7NFpv1xIEPhdH77cL/rngGgwmPgqJoBq xvVX+aO1wFkcrloaM0rAnk9QsU3WmWGvNVwFI0ZzUGv7G0qgIiosFq2tw3TtNdqEvHLJ 36aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ibhe8iagioaka1tzM2AZbdnHvwqyJt+yiFETq3dp4fk=; b=WQr7j1g4SMYBV4weUHA6ayjM4iH4IrRL3M5aUWPsibsSDRQLsZfy2QeF+Z3teKvr/u pdeGlZ+LWVJ2dntppOME+gsXc3qODA91CCciWdIlepITBwj/19qbMSGXruSWZF64FAs4 P4bkEK/ukh7enZy3W5YBOPlr6zADDBKzBVvUj969S5lWSufoCBwDi85TkOB3duh2mLdT egFSKwHMagCGOdeVpxPUmQJuEZ3Mgoi0HHbpSwh3ZaemSQHPsvqUGKbHd7Tg0WyqYXlw /wRwUgfkMYh5PgsKZzQE6R5UidNbCqBQ9tTi0PIImjrgzxFIbYqixaCQMSpiKMEEFGNj 1suQ== X-Gm-Message-State: APjAAAVgjRH0HcopK2kdAYgXIHty5L1ik42ozuRFEeGpQwB7/FkVueWS mQCQJCwpBX0U+cR+jf/IeLVjgo31 X-Google-Smtp-Source: APXvYqzOzq4Kb0zLQTd7elXbZwolStTzzw2idFZdLY9c6MdAG7Vf3Bd3AyFQF3CaDem5pdZE8s/OmA== X-Received: by 2002:a17:902:758d:: with SMTP id j13mr2942540pll.55.1573639653427; Wed, 13 Nov 2019 02:07:33 -0800 (PST) Received: from localhost.localdomain (123202047155.ctinets.com. [123.202.47.155]) by smtp.gmail.com with ESMTPSA id d6sm2113297pfn.32.2019.11.13.02.07.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 02:07:32 -0800 (PST) From: Tom Yan To: openvpn-devel@lists.sourceforge.net Date: Wed, 13 Nov 2019 18:06:59 +0800 Message-Id: <20191113100702.6863-1-tom.ty89@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <61c1b837-3f81-6783-5934-8128bb81881b@unstable.cc> References: <61c1b837-3f81-6783-5934-8128bb81881b@unstable.cc> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tom.ty89[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.214.180 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.214.180 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.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (tom.ty89[at]gmail.com) -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 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Headers-End: 1iUpYp-00ExYh-Kc Subject: [Openvpn-devel] [PATCH v2 1/4] Avoid repeating code for tap and tun+subnet in server directive 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 It also avoids limitation (i.e. netbits <= 29) that does not apply to the subnet topology. --- src/openvpn/helper.c | 74 ++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 47 deletions(-) diff --git a/src/openvpn/helper.c b/src/openvpn/helper.c index ff9df506..470b9120 100644 --- a/src/openvpn/helper.c +++ b/src/openvpn/helper.c @@ -286,13 +286,13 @@ helper_client_server(struct options *o) print_netmask(IFCONFIG_POOL_MIN_NETBITS, &gc)); } - if (dev == DEV_TYPE_TUN) + if (dev == DEV_TYPE_TUN && (topology == TOP_NET30 || topology == TOP_P2P)) { int pool_end_reserve = 4; if (netbits > 29) { - msg(M_USAGE, "--server directive when used with --dev tun must define a subnet of %s or lower", + msg(M_USAGE, "subnet must be %s or lower", print_netmask(29, &gc)); } @@ -304,66 +304,39 @@ helper_client_server(struct options *o) o->mode = MODE_SERVER; o->tls_server = true; - if (topology == TOP_NET30 || topology == TOP_P2P) + o->ifconfig_local = print_in_addr_t(o->server_network + 1, 0, &o->gc); + o->ifconfig_remote_netmask = print_in_addr_t(o->server_network + 2, 0, &o->gc); + + if (!(o->server_flags & SF_NOPOOL)) { - o->ifconfig_local = print_in_addr_t(o->server_network + 1, 0, &o->gc); - o->ifconfig_remote_netmask = print_in_addr_t(o->server_network + 2, 0, &o->gc); - - if (!(o->server_flags & SF_NOPOOL)) - { - o->ifconfig_pool_defined = true; - o->ifconfig_pool_start = o->server_network + 4; - o->ifconfig_pool_end = (o->server_network | ~o->server_netmask) - pool_end_reserve; - ifconfig_pool_verify_range(M_USAGE, o->ifconfig_pool_start, o->ifconfig_pool_end); - } - - helper_add_route(o->server_network, o->server_netmask, o); - if (o->enable_c2c) - { - push_option(o, print_opt_route(o->server_network, o->server_netmask, &o->gc), M_USAGE); - } - else if (topology == TOP_NET30) - { - push_option(o, print_opt_route(o->server_network + 1, 0, &o->gc), M_USAGE); - } + o->ifconfig_pool_defined = true; + o->ifconfig_pool_start = o->server_network + 4; + o->ifconfig_pool_end = (o->server_network | ~o->server_netmask) - pool_end_reserve; + ifconfig_pool_verify_range(M_USAGE, o->ifconfig_pool_start, o->ifconfig_pool_end); } - else if (topology == TOP_SUBNET) + + helper_add_route(o->server_network, o->server_netmask, o); + if (o->enable_c2c) { - o->ifconfig_local = print_in_addr_t(o->server_network + 1, 0, &o->gc); - o->ifconfig_remote_netmask = print_in_addr_t(o->server_netmask, 0, &o->gc); - - if (!(o->server_flags & SF_NOPOOL)) - { - o->ifconfig_pool_defined = true; - o->ifconfig_pool_start = o->server_network + 2; - o->ifconfig_pool_end = (o->server_network | ~o->server_netmask) - 2; - ifconfig_pool_verify_range(M_USAGE, o->ifconfig_pool_start, o->ifconfig_pool_end); - } - o->ifconfig_pool_netmask = o->server_netmask; - - push_option(o, print_opt_route_gateway(o->server_network + 1, &o->gc), M_USAGE); - if (!o->route_default_gateway) - { - o->route_default_gateway = print_in_addr_t(o->server_network + 2, 0, &o->gc); - } + push_option(o, print_opt_route(o->server_network, o->server_netmask, &o->gc), M_USAGE); } - else + else if (topology == TOP_NET30) { - ASSERT(0); + push_option(o, print_opt_route(o->server_network + 1, 0, &o->gc), M_USAGE); } - push_option(o, print_opt_topology(topology, &o->gc), M_USAGE); } - else if (dev == DEV_TYPE_TAP) + else if (dev == DEV_TYPE_TAP || (dev == DEV_TYPE_TUN && topology == TOP_SUBNET)) { if (netbits > 30) { - msg(M_USAGE, "--server directive when used with --dev tap must define a subnet of %s or lower", + msg(M_USAGE, "subnet must be %s or lower", print_netmask(30, &gc)); } o->mode = MODE_SERVER; o->tls_server = true; + o->ifconfig_local = print_in_addr_t(o->server_network + 1, 0, &o->gc); o->ifconfig_remote_netmask = print_in_addr_t(o->server_netmask, 0, &o->gc); @@ -371,18 +344,25 @@ helper_client_server(struct options *o) { o->ifconfig_pool_defined = true; o->ifconfig_pool_start = o->server_network + 2; - o->ifconfig_pool_end = (o->server_network | ~o->server_netmask) - 1; + o->ifconfig_pool_end = (o->server_network | ~o->server_netmask) - 2; ifconfig_pool_verify_range(M_USAGE, o->ifconfig_pool_start, o->ifconfig_pool_end); } o->ifconfig_pool_netmask = o->server_netmask; push_option(o, print_opt_route_gateway(o->server_network + 1, &o->gc), M_USAGE); + if (dev == DEV_TYPE_TUN && !o->route_default_gateway) + { + o->route_default_gateway = print_in_addr_t(o->server_network + 2, 0, &o->gc); + } } else { ASSERT(0); } + if (dev == DEV_TYPE_TUN) + push_option(o, print_opt_topology(topology, &o->gc), M_USAGE); + /* set push-ifconfig-constraint directive */ if ((dev == DEV_TYPE_TAP || topology == TOP_SUBNET)) { From patchwork Tue Nov 12 23:07:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Yan X-Patchwork-Id: 915 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id gHtjFCbWy128SgAAIUCqbw for ; Wed, 13 Nov 2019 05:08:38 -0500 Received: from proxy16.mail.iad3b.rsapps.net ([172.31.255.6]) by director10.mail.ord1d.rsapps.net with LMTP id WOUfESbWy11+fwAApN4f7A ; Wed, 13 Nov 2019 05:08:38 -0500 Received: from smtp15.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy16.mail.iad3b.rsapps.net with LMTP id qFYoCybWy11oUwAAPj+4aA ; Wed, 13 Nov 2019 05:08:38 -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: smtp15.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=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: 8ef6f8ba-05fd-11ea-aa4e-5254003d6d3a-1-1 Received: from [216.105.38.7] ([216.105.38.7:52932] helo=lists.sourceforge.net) by smtp15.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 8A/A0-23696-526DBCD5; Wed, 13 Nov 2019 05:08:38 -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 1iUpYv-0001uA-5d; Wed, 13 Nov 2019 10:07:45 +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 1iUpYs-0001tz-Vy for openvpn-devel@lists.sourceforge.net; Wed, 13 Nov 2019 10:07:42 +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=0VCjwGGiMMeyKaZE0Y0iWDJz1IQgssJMW2D7PVjnSj8=; b=iPGmA0d24aqpl+FwmaJqkDbjZ1 nPQbztY+oWCLNDD7jresBgKlM04qUVm8RWWD7qO43AwnmMM2rzmFU9kfgFkKUzGOTvoOH9srmzxUW mbWZiTwA1bprc/usb4LTtokhpeBDWQ76DbLIKXD6N+ckTrmCmtWh4ZO67V5KxYBGQxq4=; 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=0VCjwGGiMMeyKaZE0Y0iWDJz1IQgssJMW2D7PVjnSj8=; b=AVsccSIXE7GRVMQtIrzfc64TGw iFbuKLzYbAD6/vfSsutNTeoWgd1BUVUBGAHKPn0Zpo1/SJBrWx4GQuBHgZ07ajQPx+gAp4jo6PUZX KQxEu/thHInZz9ZnjIECfxEReQINvRkXn5SF1Cy2L4ADm5GcSPC8m74SYHKhetPLlojY=; Received: from mail-pf1-f169.google.com ([209.85.210.169]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1iUpYr-00ExYo-3G for openvpn-devel@lists.sourceforge.net; Wed, 13 Nov 2019 10:07:42 +0000 Received: by mail-pf1-f169.google.com with SMTP id p24so1337744pfn.4 for ; Wed, 13 Nov 2019 02:07:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0VCjwGGiMMeyKaZE0Y0iWDJz1IQgssJMW2D7PVjnSj8=; b=bZPqAxFM33+42UGRSWA+o+boLH+elraMBs27zutEDfSpxrHZJcf71eZt/7rh1Yl6OR o92IVqieMELEgTjvHrXhAz339tqvSBlLi9UxKUOCsoliGTgIwX7sK3fV3A1QyeZ3k/wq y455Rfh1H/k035rzyRrUJs6ugb4ppSyHpZCkv885GLCGFvOQhwBPomICdMBvzeqMVkEA OdMJjzUnXsz7D/as+cprAHbHRZXD1+oeStKdz//Wi7zdGZRB/VQrPaDFkTL9L+g03fTQ rVO/zopYIsogy7Vy9feEXPdlqxXeJzcKGcnfV14JTDChsx5trZrqHiDU47zZ/ZmtczQC Q5Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0VCjwGGiMMeyKaZE0Y0iWDJz1IQgssJMW2D7PVjnSj8=; b=csoBQ+X2ji0RPgfZk+YKUu/+vTPekCUc0Qgnvrd4a/odIAzjg+w6tVGkYnFRuKqH35 idmfJP3oU0V19I5FprFJIwqwoWTRNbpUpPJr+1T5/jgb4XbRnB0+f+n0zf5RzJyIdlLr ErUqqJNp5EvaWLndBOBQjcIrgmaq2uYE6IH770C8mkmJJBrXY38/AT7kfRtbp6YnJur5 65zfH8vplnrg7GVizx4saB5Vw5nB3HRbpBfr0uAgNDwmhkJ/fDpUkf8zV/ETxbPkwyYv KyAM44BK4DlZ4tyjZ5c/nGpJMB7CS60F5ffjfrDJeaiGSAIWsppmr/hRuZJzW6NbsLLd 6FFw== X-Gm-Message-State: APjAAAU9fGDWokrAqvq4QhIkb7PcTc8WwhW30HKsenrmcH/zYq4kDhiy aqEl99MRHsOvQdhhtiqAfHfQwy0q X-Google-Smtp-Source: APXvYqzazssi+aiNPceqpwRbF9BomHq1htCQjbPeYzIuLeQqvIIbXRnjADyFMFmbXAQJmkJPiB8nRw== X-Received: by 2002:a63:6483:: with SMTP id y125mr2780805pgb.444.1573639655003; Wed, 13 Nov 2019 02:07:35 -0800 (PST) Received: from localhost.localdomain (123202047155.ctinets.com. [123.202.47.155]) by smtp.gmail.com with ESMTPSA id d6sm2113297pfn.32.2019.11.13.02.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 02:07:34 -0800 (PST) From: Tom Yan To: openvpn-devel@lists.sourceforge.net Date: Wed, 13 Nov 2019 18:07:00 +0800 Message-Id: <20191113100702.6863-2-tom.ty89@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <61c1b837-3f81-6783-5934-8128bb81881b@unstable.cc> References: <61c1b837-3f81-6783-5934-8128bb81881b@unstable.cc> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tom.ty89[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.210.169 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.210.169 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.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (tom.ty89[at]gmail.com) -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 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Headers-End: 1iUpYr-00ExYo-3G Subject: [Openvpn-devel] [PATCH v2 2/4] Fix server directive for /31 subnet 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 As /31 subnet now works (as we stop setting broadcast address), the server directives can be fixed for it as well. --- src/openvpn/helper.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/openvpn/helper.c b/src/openvpn/helper.c index 470b9120..5b2ca0cc 100644 --- a/src/openvpn/helper.c +++ b/src/openvpn/helper.c @@ -328,31 +328,36 @@ helper_client_server(struct options *o) } else if (dev == DEV_TYPE_TAP || (dev == DEV_TYPE_TUN && topology == TOP_SUBNET)) { - if (netbits > 30) + int ptp = 1; + + if (netbits > 31) { msg(M_USAGE, "subnet must be %s or lower", - print_netmask(30, &gc)); + print_netmask(31, &gc)); } + if (netbits == 31) + ptp = 0; + o->mode = MODE_SERVER; o->tls_server = true; - o->ifconfig_local = print_in_addr_t(o->server_network + 1, 0, &o->gc); + o->ifconfig_local = print_in_addr_t(o->server_network + ptp, 0, &o->gc); o->ifconfig_remote_netmask = print_in_addr_t(o->server_netmask, 0, &o->gc); if (!(o->server_flags & SF_NOPOOL)) { o->ifconfig_pool_defined = true; - o->ifconfig_pool_start = o->server_network + 2; - o->ifconfig_pool_end = (o->server_network | ~o->server_netmask) - 2; + o->ifconfig_pool_start = o->server_network + ptp + 1; + o->ifconfig_pool_end = (o->server_network | ~o->server_netmask) - ptp * 2; ifconfig_pool_verify_range(M_USAGE, o->ifconfig_pool_start, o->ifconfig_pool_end); } o->ifconfig_pool_netmask = o->server_netmask; - push_option(o, print_opt_route_gateway(o->server_network + 1, &o->gc), M_USAGE); + push_option(o, print_opt_route_gateway(o->server_network + ptp, &o->gc), M_USAGE); if (dev == DEV_TYPE_TUN && !o->route_default_gateway) { - o->route_default_gateway = print_in_addr_t(o->server_network + 2, 0, &o->gc); + o->route_default_gateway = print_in_addr_t(o->server_network + ptp + 1, 0, &o->gc); } } else From patchwork Tue Nov 12 23:07:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Yan X-Patchwork-Id: 917 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id cJpuLCrWy13oEgAAIUCqbw for ; Wed, 13 Nov 2019 05:08:42 -0500 Received: from proxy15.mail.iad3b.rsapps.net ([172.31.255.6]) by director12.mail.ord1d.rsapps.net with LMTP id EAXaKSrWy10PbAAAIasKDg ; Wed, 13 Nov 2019 05:08:42 -0500 Received: from smtp20.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.iad3b.rsapps.net with LMTP id 8FyPIyrWy12TNAAAhyf7VQ ; Wed, 13 Nov 2019 05:08:42 -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: smtp20.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=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: 91aa6c9a-05fd-11ea-a8aa-525400497f28-1-1 Received: from [216.105.38.7] ([216.105.38.7:37694] helo=lists.sourceforge.net) by smtp20.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 4A/6B-19576-A26DBCD5; Wed, 13 Nov 2019 05:08:42 -0500 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.90_1) (envelope-from ) id 1iUpYu-0005Nf-TT; Wed, 13 Nov 2019 10:07:44 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iUpYt-0005NL-Tb for openvpn-devel@lists.sourceforge.net; Wed, 13 Nov 2019 10:07:43 +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=fad6sl6cruE1X3IU1JKK0kgcrCHM936Nq0JvzzaJ2ao=; b=WAA/SqcouSEZaGJQNEyGdlUzeV bzOBLV1+G/ixVFNKs9OYRKDTUelmeAmGuwz68XbQFHQ4jyCx1cRrJDXrg+e+aMD6wRgkBNFZJA6qr uotym1q9gYm8/sShFXuu5pjQ8jSuMzrKGzMuQq523uk3vKBxKK+TRLPAIKpPLxzC5rPo=; 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=fad6sl6cruE1X3IU1JKK0kgcrCHM936Nq0JvzzaJ2ao=; b=TCCxfUpZs2ey++qCwMLX+5+SnH tlCvCLpzGSFJK/EhVKWbwudCBFSI9uluo4hegge5H8GDOkZq73U8ILT6bwxTr8QVSmuZSDaHhy0K1 ZKtEIJkPKnYCVzFjZftoOF2XeDjNl4dhrlFjKkFPwCxuASdNC9X68iWzYNaeJsOjVHYc=; Received: from mail-pf1-f173.google.com ([209.85.210.173]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1iUpYs-00Enyo-PG for openvpn-devel@lists.sourceforge.net; Wed, 13 Nov 2019 10:07:43 +0000 Received: by mail-pf1-f173.google.com with SMTP id n13so1344235pff.1 for ; Wed, 13 Nov 2019 02:07:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fad6sl6cruE1X3IU1JKK0kgcrCHM936Nq0JvzzaJ2ao=; b=p837dCKuPBd4d0HDsK4lnSf1tGC9zOqljnZPX8w60Zlf3DX0Pew0Fpti9uu3fCpOGT Q9aNJTBuTE85GNf99neKZSroDpSHtya+qMNuz4bLsO3A5Pc/Ar1MnD+vfrqzUS+Tc3BH uKQQ3c060Yyg9K54u8GsDzYvYgDlJGW09p7bPQ86AXnI1+1bOK4QlsymtVZU6G6Y5chN 7/dN8JskvnNAkyeaEDnf9lzpcMaPLNaC4HR8h8TIpsKz70e5Z0G54aHGdhYx2ZYQAr6u Tv32cGqUI6oAE+YcqvqSJIz7yGybcSnkzmA5tF3gmfakL0Du2czuYNJnNcrXkygxlGN6 x4fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fad6sl6cruE1X3IU1JKK0kgcrCHM936Nq0JvzzaJ2ao=; b=XDPelbGeMNK3gNHqsj+cCxryMQYwm2kPXtHiSxZKu9JNGgPAnpIZ6lNCzOdL/t/c2R mRvg5B41uqJl295cg+XTQu+VK9GXwI3/ECMRGKM82tnJA2+/FRV4//5FnkhvlhGjYpLE 0d78d6lm5Q/fDFEuHPPgpd4o5jAXsY+oKvm+032bsj//MdCZraSx3gzyoS7YmAg1lIaq cV+T+nD/4/nQI+mzDyGVU74lnTOkCXelSSa9UiXVRvs3fwpU3rT0wjpzbqdx0SCj8ioL Kng9OxyIc0hRlFITKAb/QOiThscvVRRFl/0AkWp34b4yVBnOFiEVd2Ya18JbUfJ1Y6xb s4cg== X-Gm-Message-State: APjAAAVeOKbn6muxd7azOfh37FS6ijIBCYrFxfjCIZm/z39gMeYmqcwk oo/aeOXLmz6BxHWv8ymfjxgKLKGA X-Google-Smtp-Source: APXvYqx2rMgMQG+1eo/7e891afqnWUpEHBiqw/ZHXR/pmHMrTf37je00E08SWGTYxHQVaArK1jAoMg== X-Received: by 2002:a17:90a:b28c:: with SMTP id c12mr1554123pjr.22.1573639656623; Wed, 13 Nov 2019 02:07:36 -0800 (PST) Received: from localhost.localdomain (123202047155.ctinets.com. [123.202.47.155]) by smtp.gmail.com with ESMTPSA id d6sm2113297pfn.32.2019.11.13.02.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 02:07:35 -0800 (PST) From: Tom Yan To: openvpn-devel@lists.sourceforge.net Date: Wed, 13 Nov 2019 18:07:01 +0800 Message-Id: <20191113100702.6863-3-tom.ty89@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <61c1b837-3f81-6783-5934-8128bb81881b@unstable.cc> References: <61c1b837-3f81-6783-5934-8128bb81881b@unstable.cc> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tom.ty89[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.210.173 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.210.173 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.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (tom.ty89[at]gmail.com) -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 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Headers-End: 1iUpYs-00Enyo-PG Subject: [Openvpn-devel] [PATCH v2 3/4] Avoid reserving one more address at pool end 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 It appears to be a copy-and-paste kind of typo (pool start is network address + 2). --- src/openvpn/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/helper.c b/src/openvpn/helper.c index 5b2ca0cc..6e2f0891 100644 --- a/src/openvpn/helper.c +++ b/src/openvpn/helper.c @@ -349,7 +349,7 @@ helper_client_server(struct options *o) { o->ifconfig_pool_defined = true; o->ifconfig_pool_start = o->server_network + ptp + 1; - o->ifconfig_pool_end = (o->server_network | ~o->server_netmask) - ptp * 2; + o->ifconfig_pool_end = (o->server_network | ~o->server_netmask) - ptp; ifconfig_pool_verify_range(M_USAGE, o->ifconfig_pool_start, o->ifconfig_pool_end); } o->ifconfig_pool_netmask = o->server_netmask; From patchwork Tue Nov 12 23:07:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Yan X-Patchwork-Id: 914 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 6NW4GiTWy12pAwAAIUCqbw for ; Wed, 13 Nov 2019 05:08:36 -0500 Received: from proxy12.mail.iad3b.rsapps.net ([172.31.255.6]) by director9.mail.ord1d.rsapps.net with LMTP id WDRRGCTWy11wAgAAalYnBA ; Wed, 13 Nov 2019 05:08:36 -0500 Received: from smtp26.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy12.mail.iad3b.rsapps.net with LMTP id 8H6iESTWy12RbgAAEsW3lA ; Wed, 13 Nov 2019 05:08:36 -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: smtp26.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=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: 8de4141c-05fd-11ea-9e14-5254001088d3-1-1 Received: from [216.105.38.7] ([216.105.38.7:49132] helo=lists.sourceforge.net) by smtp26.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id AD/14-13579-326DBCD5; Wed, 13 Nov 2019 05:08:36 -0500 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1iUpYw-0007kv-KY; Wed, 13 Nov 2019 10:07:46 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iUpYv-0007ko-SC for openvpn-devel@lists.sourceforge.net; Wed, 13 Nov 2019 10:07:45 +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=KUhNovZvfxVyeK82GPDDYycCnq9oSqytZJi5V0ZHq7U=; b=Dc3/Fk297G63bUeRj08LJW1ysF g5s+e3ZFQF7HwUTQ/K4Bsw1aZuSQYQu55U4HjN5I+nJuPNuifwYYTEm7hGOoh2fhkItjTBpw/PpF7 JcGM7aFtDZZQnzeqetasBzePYuyIQfI6i+8M5ZlBDzcMVCzshmOB9u/Tc8AqPothABGk=; 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=KUhNovZvfxVyeK82GPDDYycCnq9oSqytZJi5V0ZHq7U=; b=M2JtVeXHUoaoyDFWm00y3e2B9V 1uP3CKYLRfiMoSvSrOvGV6Rg1kKVGg5UKf1l4fVfMc61ofq8xZOL9+mJ/HpXHMZgczeeedgK3opoC iYIMMVngpGoVUIljqHwhUew7GG0A0qC/wuxm7dIuDd6FkwBT5dNxueyVjfw9//JdzbCA=; Received: from mail-pf1-f170.google.com ([209.85.210.170]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1iUpYu-00ExZ4-4T for openvpn-devel@lists.sourceforge.net; Wed, 13 Nov 2019 10:07:45 +0000 Received: by mail-pf1-f170.google.com with SMTP id q26so1309276pfn.11 for ; Wed, 13 Nov 2019 02:07:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KUhNovZvfxVyeK82GPDDYycCnq9oSqytZJi5V0ZHq7U=; b=LsHUe1PqbezJMEzAG5mGHuArdmLVziNBC4pzAtsgKa+O2n4TISTcSHm2aNkOggo7fw QPPl+ucwCZUSdeEqfspriXXu9Do742qbI64+YTj544LSVDhfATdfovvLzzlDvLQ4FqGv vsL2BFcaGbn/OVnLvvLNXx1FJYiGvHzxmsLJ2fvTFGOiQCN7MNHBj/17LOvkigm1gXlg k9T+7CwnK1hK5lCFZb16UycQZVwQJdHmxzT+hjCIm6gTnUQdTOdeA/6qUCwn4KYbsN8+ +x4gH0hJlMsxcUY8yGzeQkTeLND6OLH3LymA4MUH9Z3xm800XnsNN/7uQ0CAxC5Fdy+f 6iWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KUhNovZvfxVyeK82GPDDYycCnq9oSqytZJi5V0ZHq7U=; b=tCNHpqUrP6x3X8nK7LoUmSqJlRutW0koSIHhUKSjJHpiM5+08FrhR4dIfV5Qwgdim9 gcB1rQoR6AjxaOpCilRVbO0zISBCKLsOSXtfxwAc8Yf0qnuvKR6qijXRALcTFAhz5z5L jlGZQxjxTq1CgnAi8ssfw1+/5k/fvb2wVayHxRKfa2fAsrrN9Z6BjRn9BxXSgyf/iH0C /6UyAmJinLknM2RBAvHjaqCxMFoSftnYzlXNi6v8p8sOzGqo539Qbcs8V5EPPvc71UNe 4kBmncPl6/+daophFbQqK4vDcNs17P+4GNKuF1q+2ipmakYEbZnGEcuymk/JLEuhfji3 uZ5g== X-Gm-Message-State: APjAAAUOXlCnXXCl6XNWj5chne6XL55hmB3w1yc4yELT7JqPwtN7baoD 8bqbe51omVDGfmnFfxAwRpypxHWq X-Google-Smtp-Source: APXvYqxjBX+OuZ5IV62FQig+QyBC8ovT/vzi5MDL7fIRuoYoPvtS0hY1s6IGuH4/XQ0D8xXoN1wpkA== X-Received: by 2002:a63:6782:: with SMTP id b124mr2851102pgc.220.1573639658116; Wed, 13 Nov 2019 02:07:38 -0800 (PST) Received: from localhost.localdomain (123202047155.ctinets.com. [123.202.47.155]) by smtp.gmail.com with ESMTPSA id d6sm2113297pfn.32.2019.11.13.02.07.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 02:07:37 -0800 (PST) From: Tom Yan To: openvpn-devel@lists.sourceforge.net Date: Wed, 13 Nov 2019 18:07:02 +0800 Message-Id: <20191113100702.6863-4-tom.ty89@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <61c1b837-3f81-6783-5934-8128bb81881b@unstable.cc> References: <61c1b837-3f81-6783-5934-8128bb81881b@unstable.cc> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tom.ty89[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (tom.ty89[at]gmail.com) -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 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.210.170 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.210.170 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Headers-End: 1iUpYu-00ExZ4-4T Subject: [Openvpn-devel] [PATCH v2 4/4] Do not set pool netmask when nopool is set 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 The setting probably just slipped out of the if-block over rewrites. --- src/openvpn/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/helper.c b/src/openvpn/helper.c index 6e2f0891..a36bc63a 100644 --- a/src/openvpn/helper.c +++ b/src/openvpn/helper.c @@ -351,8 +351,8 @@ helper_client_server(struct options *o) o->ifconfig_pool_start = o->server_network + ptp + 1; o->ifconfig_pool_end = (o->server_network | ~o->server_netmask) - ptp; ifconfig_pool_verify_range(M_USAGE, o->ifconfig_pool_start, o->ifconfig_pool_end); + o->ifconfig_pool_netmask = o->server_netmask; } - o->ifconfig_pool_netmask = o->server_netmask; push_option(o, print_opt_route_gateway(o->server_network + ptp, &o->gc), M_USAGE); if (dev == DEV_TYPE_TUN && !o->route_default_gateway)