From patchwork Sat Nov 2 18:31:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Yan X-Patchwork-Id: 876 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 gKFLEKZmvl2ecAAAIUCqbw for ; Sun, 03 Nov 2019 01:33:26 -0400 Received: from proxy10.mail.ord1d.rsapps.net ([172.30.191.6]) by director10.mail.ord1d.rsapps.net with LMTP id ECcdEKZmvl0EIAAApN4f7A ; Sun, 03 Nov 2019 01:33:26 -0400 Received: from smtp28.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy10.mail.ord1d.rsapps.net with LMTP id 0BzbD6Zmvl3BWwAAfSg8FQ ; Sun, 03 Nov 2019 01:33:26 -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: smtp28.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; 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: 750b159e-fdfb-11e9-84c0-525400ea129b-1-1 Received: from [216.105.38.7] ([216.105.38.7:33468] helo=lists.sourceforge.net) by smtp28.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id EC/10-31126-5A66EBD5; Sun, 03 Nov 2019 01:33:26 -0400 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 1iR8V2-0001qP-DK; Sun, 03 Nov 2019 05:32:28 +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 1iR8V1-0001qJ-Su for openvpn-devel@lists.sourceforge.net; Sun, 03 Nov 2019 05:32:27 +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: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=pHESTYA3cE70pLyWyzkGo5yeVN3udMGlpMDo2DUJ3zE=; b=N5iR+rSUBh+FbAU//fEWZaeiM7 oJrVIgJsOO7FQHKfGXHGqHk7L76NlbKtQDuK/9vljKUmqxnNoXw/lrcJfeR2ug2WpH/JY+Tdsn1G9 FUjIzopanyQDtIDSQ5IIU9W04rwqEPKCrZ9WBTDVx8WFx2EOlQi4ns5cJj9BH6W3g+As=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version: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:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=pHESTYA3cE70pLyWyzkGo5yeVN3udMGlpMDo2DUJ3zE=; b=k ch24pPAwDtgz0mDGNq2jfan2hoqAOkC0rVlPBlaqtdST8zhzfcBvJm3sel57UwOcDYLaKsLSzzvBN 1GWXSB9SSkTwtnwuN5St5U6d7r01ELdVx8xKQt51S0E//JfxZ6WdWGZxqeyPllXDRICtlTdY71Em6 fJs94Tsrz9yDRyWw=; Received: from mail-pg1-f174.google.com ([209.85.215.174]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1iR8Ux-00Feqb-Oo for openvpn-devel@lists.sourceforge.net; Sun, 03 Nov 2019 05:32:27 +0000 Received: by mail-pg1-f174.google.com with SMTP id z24so4570775pgu.4 for ; Sat, 02 Nov 2019 22:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pHESTYA3cE70pLyWyzkGo5yeVN3udMGlpMDo2DUJ3zE=; b=Wn8xX576zepwRHVCBx4PM1ssQOG5/vwmCJUBIXsDw2s0PgKGxLrnbwoY0B8VjWck2N pBq0uoYMsQP4iqrsxZ79U2IWhjFaVS4FWgbxBDL2Atcagjr0Vhe3h24o7qMvZVKreoOJ i5H085clabY0ZE5ts5xz8fgPzkoEnErgVUSTXIxSkHHaGpIsGh9m3AkyqzwB+snmA5Z9 nzOxrL22dEAUkC4PHQ+p78RtC0ZiKxGAm/khU8g3XSPMePM6l6Lbz0SnXe7YMKTH+8Do 4JhvCMlo63ZXy3j1PQwwMGGVo43Y+ccqmlGHaXxaDK+2e1mg9pX047yUde5fKsXV5GS7 SyJg== 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:mime-version :content-transfer-encoding; bh=pHESTYA3cE70pLyWyzkGo5yeVN3udMGlpMDo2DUJ3zE=; b=AbuiUr5zV56Z34QnfgFqw2VxxKQZdXk1FrZCuqsA525LBeerJ2+PRms+0DocSqiKou 2Ba45JyvzClV8Mdp1nfffOy3QFpVIlgRaT8Su9uwh2s20rOpd4rWLuat6rkyr0q2dIlF 1DzJlJiIRrweiF0KR92h9HrMEkzBz6Sv5yzDTILAmLe9vphpeIF7TeLlH4gYkHXzCDo+ wax83GSXFOhH9wnl1aB59pRXs552foGzUpSTk/q/4USPrgSxUfQM0A+6I5zWS/TIEEay TJRPFN++Cldg2wDm7kVQwbwEuO+erSSPvhZDrddOPESGLTBDCkTIIaBdeIlJAM3ZPm+L P62Q== X-Gm-Message-State: APjAAAWq9cgoUkgt67NRzh0XCvarUCNVge9TIgDCu4US4X2b41OJvAex 875qbnX0oeQekP/loNod3AJlnv8w X-Google-Smtp-Source: APXvYqyATqaw2mYpBB2UQ7E6OogyTdHqCv0GF2rgM/IxbCs1r0XKiWbXTMkLtmD/bmOkoD/KJsD3fg== X-Received: by 2002:aa7:8598:: with SMTP id w24mr211578pfn.8.1572759137872; Sat, 02 Nov 2019 22:32:17 -0700 (PDT) Received: from localhost.localdomain (123202047155.ctinets.com. [123.202.47.155]) by smtp.gmail.com with ESMTPSA id i11sm11142038pgd.7.2019.11.02.22.32.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2019 22:32:17 -0700 (PDT) From: Tom Yan To: openvpn-devel@lists.sourceforge.net Date: Sun, 3 Nov 2019 13:31:48 +0800 Message-Id: <20191103053148.18059-1-tom.ty89@gmail.com> X-Mailer: git-send-email 2.23.0 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.215.174 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.174 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 -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1iR8Ux-00Feqb-Oo Subject: [Openvpn-devel] [PATCH] tun/iproute2: support 31-bit ipv4 prefix (RFC 3021) 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 --- src/openvpn/tun.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 80eaa2c4..f5823516 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -965,13 +965,14 @@ do_ifconfig(struct tuntap *tt, else { argv_printf(&argv, - "%s addr add dev %s %s/%d broadcast %s", + "%s addr add dev %s %s/%d", iproute_path, actual, ifconfig_local, - netmask_to_netbits2(tt->remote_netmask), - ifconfig_broadcast + netmask_to_netbits2(tt->remote_netmask) ); + if (netmask_to_netbits2(tt->remote_netmask) < 31) + argv_printf_cat(&argv, " broadcast %s", ifconfig_broadcast); argv_msg(M_INFO, &argv); openvpn_execve_check(&argv, es, S_FATAL, "Linux ip addr add failed"); }