From patchwork Mon Jan 8 20:16:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eyal Birger X-Patchwork-Id: 173 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director2.mail.ord1d.rsapps.net ([172.30.191.6]) by backend31.mail.ord1d.rsapps.net (Dovecot) with LMTP id G1W8NYJsVFoGWwAAgoeIoA for ; Tue, 09 Jan 2018 02:17:22 -0500 Received: from proxy19.mail.ord1d.rsapps.net ([172.30.191.6]) by director2.mail.ord1d.rsapps.net (Dovecot) with LMTP id C/mvNYJsVFrWTQAAgYhSiA ; Tue, 09 Jan 2018 02:17:22 -0500 Received: from smtp31.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy19.mail.ord1d.rsapps.net (Dovecot) with LMTP id andLNIJsVFofXQAAyH2SIw ; Tue, 09 Jan 2018 02:17:22 -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.34.181.88] Authentication-Results: smtp31.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.34.181.88"; 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-Classification-ID: 22d9e3b6-f50d-11e7-9209-525400b3ac8c-1-1 Received: from [216.34.181.88] ([216.34.181.88:26459] helo=lists.sourceforge.net) by smtp31.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 27/85-13117-28C645A5; Tue, 09 Jan 2018 02:17:22 -0500 Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.89) (envelope-from ) id 1eYo94-0005Tj-KH; Tue, 09 Jan 2018 07:16:26 +0000 Received: from sfi-mx-4.v28.ch3.sourceforge.com ([172.29.28.194] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1eYo93-0005Tb-EO for openvpn-devel@lists.sourceforge.net; Tue, 09 Jan 2018 07:16:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding: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=Jp1Sq874jz4TiDMK0twUdjxrcYzsDbtKAejjTON77rY=; b=WvdbYt1u8bb3Y5lnr2BVMFnMEi LxubQ4F11wee/rE32TVuFo1LpnBylx61Cju+16P+chBKkc76aWJswRVy679dyrjxqjYYLVxF0kQok 6ghzXNAPNSMg6coe2u7PKXMfL+g+cmCkRbkQ3YickZ3YRT7bdFSKT3URpWj6o44R4dlI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding: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=Jp1Sq874jz4TiDMK0twUdjxrcYzsDbtKAejjTON77rY=; b=ZF360dPqhGiMIySLzFyntV0upf k2LcmwKlTVifZgtgTKu2hanHrVM5p3qlgH3iK2RTpCLz8w4IoSP22hFp1fUAmlVIuCsSvm6WGV6q0 Hk/j6yfapwWtSDCPqtNYGgmf5uNa3fOETFMAS7+PQNjo0trgCZRA4Ifx8mGRlHoc5uc4=; Received: from mail-wm0-f67.google.com ([74.125.82.67]) by sfi-mx-4.v28.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) id 1eYo92-0003f7-KI for openvpn-devel@lists.sourceforge.net; Tue, 09 Jan 2018 07:16:25 +0000 Received: by mail-wm0-f67.google.com with SMTP id f140so18498225wmd.2 for ; Mon, 08 Jan 2018 23:16:24 -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; bh=Jp1Sq874jz4TiDMK0twUdjxrcYzsDbtKAejjTON77rY=; b=PHqXmRiI5IeVZJOA5bPw62EfGSnmmK5H/a/cRP2EA8XtzG6yTnRJFmIP84Q/Kqp4Y/ 9nUecpoYOiu5oelZ9hMQdluGsH9cAlRWo4e42njhG7NoE6ObaLfGuE6AcwvhCjfJu/fF f3CrjMKjhvAdRmg2lYpomQtHLShAofbHgNgesDuqkzFaasmpKUTZckTNzeg3gTKGLpfs 5mC10ZUWs/2Xrh0GbH7UE5oQ7k6P93LcPOFTh2vocxCGiFDzbvI5mhal3Ykj7NGEZ0Ms 6aDYzX8pQgH/M8mXtkBg+XxsFO5i2wJFDoPewLYOx3hmBFSrdXKKNbVfynHHG9Z4arIs e+1w== 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; bh=Jp1Sq874jz4TiDMK0twUdjxrcYzsDbtKAejjTON77rY=; b=hZuuGDE1NuWa8oljnKA9WxrJymwMSlHlJn6RIrGtNeXfRStMxqhyY93wLe3OQwHFxW mBpChBFaFA93BfdMgAwnmMaNnvpej330TlkjLfg93Skl1LnhDeUakF+yTkZ60SvBrVdq VVfNu5HuZMnscsTU32L76YjwMIDx59SdZP85heZfc5PEHGwEXyIaXF1LVMzybDcyVakj K2am4SczzOH6KjWHLUsKLfACAo5eTKi9c4nEdu30I2GDUdlypsR8tveEEICvVbhp4UxL y/w+H5q7dn342p7ZYlo4lMVuzEGgWYsbsQu33bMaOMUwELqa6Z09/VTBcNF4wzAfG6r1 lyXg== X-Gm-Message-State: AKGB3mKu2YR+E7AQGxdEm32Zp3m7nkKiiQfOiPmS/kmuqbVh6CTSDALd trC3N43LhI5zKaK4X7RHLLjzgLNT X-Google-Smtp-Source: ACJfBov9zAxjEgJWbANbAgkrOSkiIf2bXALbpaSQwvcbqERlcVp+urzMUq7UWVZOBH9h1pcih+lpTQ== X-Received: by 10.28.211.75 with SMTP id k72mr11815197wmg.39.1515482178250; Mon, 08 Jan 2018 23:16:18 -0800 (PST) Received: from localhost.localdomain ([2001:4cd0:bc00:1c00:6d2c:dc0b:8e78:1b32]) by smtp.gmail.com with ESMTPSA id x75sm14925470wme.44.2018.01.08.23.16.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Jan 2018 23:16:17 -0800 (PST) From: Eyal Birger To: openvpn-devel@lists.sourceforge.net Date: Tue, 9 Jan 2018 09:16:13 +0200 Message-Id: <1515482173-29447-1-git-send-email-eyal.birger@gmail.com> X-Mailer: git-send-email 2.7.4 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 (eyal.birger[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [74.125.82.67 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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 X-Headers-End: 1eYo92-0003f7-KI Subject: [Openvpn-devel] [PATCH] Windows: Set interface IPv6 prefix length when configuring address 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: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Address prefix length defaults to /64 on Windows. This change allows using Windows clients in setups that use a different prefix length. Note: the ability to set the prefix length is documented in the netsh 'add address' command, but works on the 'set address' command as well. Signed-off-by: Eyal Birger Acked-by: Selva Nair Acked-by: Selva Nair <selva.nair@gmail.com>

Though this works in my tests I want to retract this ACK.

Apart from possible issues due to the appearance of the onlink route in some cases, I think the correct approach going forward is to stop using netsh and use the IP helper API for such tasks. And do it in the same way as done using the service.

Un-Acked-by: Selva Nair <selva.nair@gmail.com> :)

Selva
--- 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 25831ce..b2b4795 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -1561,15 +1561,16 @@ do_ifconfig(struct tuntap *tt, } else { - /* example: netsh interface ipv6 set address interface=42 2001:608:8003::d store=active */ + /* example: netsh interface ipv6 set address interface=42 2001:608:8003::d/64 store=active */ char iface[64]; openvpn_snprintf(iface, sizeof(iface), "interface=%lu", tt->adapter_index ); argv_printf(&argv, - "%s%sc interface ipv6 set address %s %s store=active", + "%s%sc interface ipv6 set address %s %s/%d store=active", get_win_sys_path(), NETSH_PATH_SUFFIX, iface, - ifconfig_ipv6_local ); + ifconfig_ipv6_local, + tt->netbits_ipv6); netsh_command(&argv, 4, M_FATAL); /* set ipv6 dns servers if any are specified */ netsh_set_dns6_servers(tt->options.dns6, tt->options.dns6_len, actual);