[Openvpn-devel] [PATCH] Set DNS Domain using iservice

2020-09-24 Thread selva . nair
From: Selva Nair 

Use wmic instead of directly editing the registry
as the former does not take full effect unless the dns
client service is restarted.

Editing the registry appears to work erratically depending
on whether its followed with a dchp renew or ipconfig /registerdns
etc.

DOMAIN-SEARCH is not handled here as wmic only supports
setting the global search list which will over-ride all
interface specific values.  Editing the registry directly
combined with a wmic command to reset the global SearchList
is an option that could be considered in a separate patch.

Trac # 1209, 1331

Signed-off-by: Selva Nair 
---
Note: this will set the domain twice if both v4 and v6 DNS
servers are defined. It cant hurt, but could be avoided by
making the domain setting a separate call from the DNS
server setting.

 src/openvpn/tun.c |  21 +--
 src/openvpnserv/interactive.c | 133 +-
 2 files changed, 147 insertions(+), 7 deletions(-)

diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 80ae695..b681905 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -159,7 +159,7 @@ do_dns_service(bool add, const short family, const struct 
tuntap *tt)
 int addr_len = add ? len : 0;
 const char *ip_proto_name = family == AF_INET6 ? "IPv6" : "IPv4";
 
-if (addr_len == 0 && add) /* no addresses to add */
+if (addr_len == 0 && !tt->options.domain && add) /* no addresses or domain 
to add */
 {
 return true;
 }
@@ -199,9 +199,21 @@ do_dns_service(bool add, const short family, const struct 
tuntap *tt)
 dns.addr[i].ipv4.s_addr = htonl(tt->options.dns[i]);
 }
 }
+if (tt->options.domain)
+{
+strncpy(dns.domains, tt->options.domain, _countof(dns.domains));
+   /* truncation of domain name is not checked as it cant happen
+* with 512 bytes room in dns.domains.
+*/
+msg(D_LOW, "%s dns domain on '%s' (if_index = %d) using service",
+(add ? "Setting" : "Deleting"), dns.iface.name, dns.iface.index);
+}
 
-msg(D_LOW, "%s %s dns servers on '%s' (if_index = %d) using service",
-(add ? "Setting" : "Deleting"), ip_proto_name, dns.iface.name, 
dns.iface.index);
+if (addr_len > 0 || !add)
+{
+msg(D_LOW, "%s %s dns servers on '%s' (if_index = %d) using service",
+(add ? "Setting" : "Deleting"), ip_proto_name, dns.iface.name, 
dns.iface.index);
+}
 
 if (!send_msg_iservice(pipe, , sizeof(dns), , "TUN"))
 {
@@ -216,7 +228,8 @@ do_dns_service(bool add, const short family, const struct 
tuntap *tt)
 goto out;
 }
 
-msg(M_INFO, "%s dns servers %s using service", ip_proto_name, (add ? "set" 
: "deleted"));
+msg(M_INFO, "%s dns servers %s%s using service", ip_proto_name,
+   (tt->options.domain? "and domain " : ""), (add ? "set" : 
"deleted"));
 ret = true;
 
 out:
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index 207cc4a..b7f144d 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -91,6 +91,7 @@ typedef enum {
 block_dns,
 undo_dns4,
 undo_dns6,
+undo_domain,
 _undo_type_max
 } undo_type_t;
 typedef list_item_t *undo_lists_t[_undo_type_max];
@@ -564,6 +565,24 @@ InterfaceLuid(const char *iface_name, PNET_LUID luid)
 return status;
 }
 
+static DWORD
+ConvertInterfaceNameToIndex(const wchar_t *ifname, NET_IFINDEX *index)
+{
+   NET_LUID luid;
+   DWORD err;
+
+   err = ConvertInterfaceAliasToLuid(ifname, );
+   if (err == ERROR_SUCCESS)
+   {
+   err = ConvertInterfaceLuidToIndex(, index);
+   }
+   if (err != ERROR_SUCCESS)
+   {
+   MsgToEventLog(M_ERR, L"Failed to find interface index for <%s>", 
ifname);
+   }
+   return err;
+}
+
 static BOOL
 CmpAddress(LPVOID item, LPVOID address)
 {
@@ -1057,6 +1076,53 @@ out:
 return err;
 }
 
+/**
+ * Run command: wmic nicconfig (InterfaceIndex=$if_index) call $action ($data)
+ * @param  if_index"index of interface"
+ * @param  action  e.g., "SetDNSDomain"
+ * @param  datadata if required for action
+ * - a single word for SetDNSDomain, empty or NULL to 
delete
+ * - comma separated values for a list
+ */
+static DWORD
+wmic_nicconfig_cmd(const wchar_t *action, const NET_IFINDEX if_index,
+   const wchar_t *data)
+{
+DWORD err = 0;
+wchar_t argv0[MAX_PATH];
+wchar_t *cmdline = NULL;
+int timeout = 1; /* in msec */
+
+swprintf(argv0, _countof(argv0), L"%s\\%s", get_win_sys_path(), 
L"wbem\\wmic.exe");
+argv0[_countof(argv0) - 1] = L'\0';
+
+const wchar_t *fmt;
+/* comma separated list must be enclosed in parenthesis */
+if (data && wcschr(data, L','))
+{
+   fmt = L"wmic nicconfig where (InterfaceIndex=%ld) call %s (%s)";
+}
+else
+{
+   fmt = L"wmic nicconfig where (InterfaceIndex=%ld) call %s %s";
+}
+
+

[Openvpn-devel] Summary of the community meeting (24th September 2020)

2020-09-24 Thread Samuli Seppänen
Hi,

Here's the summary of the IRC meeting.

---

COMMUNITY MEETING

Place: #openvpn-meeting on irc.freenode.net
Date: Thu 24th September 2020
Time: 20:00 CEST (18:00 UTC)

Planned meeting topics for this meeting were here:



Your local meeting time is easy to check from services such as



SUMMARY

becm, cron2, dazo, lev and mattock participated in this meeting.

---

Talked about OpenVPN 2.5. Noted that MSI is getting into a nice shape,
though we have some fixes pending for it. We also have a new
tap-windows6 release in the pipe.

Agreed that we want to do an RC2 release for 2.5, mainly because there
is a fair amount of changes related to Windows.

Set the release date for 2.5-rc2 to "mid next week". This gives mattock
some time to build a new tap-windows6 driver as well as get his other
urgent stuff out of the way.

---

Noted that Trac tickets related to OpenVPN Connect should be assigned to
denys.babets. He will take them from there.

--

Full chatlog attached
(21:00:08) mattock: hello
(21:01:41) dazo: hey!
(21:01:45) dazo ha scelto come argomento: Agenda at 
https://community.openvpn.net/openvpn/wiki/Topics-2020-09-24
(21:01:46) lev__: guten nacht
(21:01:59) dazo: lev__: that's when the day starts!
(21:02:20) lev__: then guten abend
(21:02:33) dazo: :-P
(21:03:50) dazo: Btw ... how's the MSI stuff going?
(21:04:12) lev__: I think it is in a good shape
(21:04:41) dazo: Great!
(21:05:19) lev__: there is one issue which could be fixed, though, but I 
wouldn't call it showstopper (support for modify/repair)
(21:05:39) dazo: so that's more a feature than a bug?
(21:05:57) cron2: now!
(21:06:01) mattock: hi
(21:06:25) lev__: both
(21:06:45) mattock: there is also some activity on tap-windows6
(21:06:51) lev__: unprivileged user may break VPN connection of administrator
(21:07:13) lev__: but we have the same problem with Connect
(21:07:22) mattock: btw. 2.0 had 18 release candidates
(21:07:31) mattock: we can do a few before breaking the record
(21:07:35) mattock: https://build.openvpn.net/downloads/releases/
(21:07:37) vpnHelper: Title: Index of /downloads/releases/ (at 
build.openvpn.net)
(21:09:57) cron2: working on it :-)
(21:10:07) cron2: mattock: have you seen that we need a new tap driver?
(21:11:52) mattock: yes, and selva said "wait"
(21:11:57) mattock: did not check later today
(21:13:09) lev__: cron2: what is the thing with new tap driver ?
(21:14:31) cron2: changing the MAC address via control panel was doubly broken
(21:14:43) cron2: .inf file was broken, setting the wrong key - that was fixed 
yesterday
(21:14:54) cron2: driver was using the wrong variable for ARP and ND - that was 
fixed today
(21:15:04) cron2: so, now things should be fixed for good
(21:16:45) lev__: cool, we should update Connect client as well
(21:19:16) mattock: what about the next rc?
(21:19:19) mattock: what, when?
(21:19:56) cron2: you tell me :-) - it should come with the new tap driver.
(21:20:01) cron2: I can do the RC2 any time
(21:20:29) lev__: I would like to add dhcp-option DOMAIN support for wintun
(21:20:31) dazo: Do we need another RC?
(21:20:52) dazo: $ git shortlog v2.5_rc1..release/2.5
(21:20:52) dazo: Simon Rozman via Openvpn-devel (4):
(21:20:52) dazo:   netsh: Specify interfaces by index rather than name
(21:20:52) dazo:   netsh: Clear existing IPv6 DNS servers before 
configuring new ones
(21:20:52) dazo:   netsh: Delete WINS servers on TUN close
(21:20:52) dazo:   openvpnmsica: Simplify find_adapters() to void return
(21:21:09) dazo: These are bugfixes ... doesn't look that scary even
(21:21:32) cron2: dazo: not on the unix side, but windows with the new driver 
and "netsh config fixes" might need another round of testing
(21:21:53) cron2: also, we are aiming to beat 2.1, which made 2.1_rc22 (not to 
forget having an rc21b!)
(21:22:07) dazo: hahahaha  oh dear!
(21:22:09) mattock: 2.0 actually
(21:22:16) mattock: 2.1.4 was the last 2.1
(21:22:18) dazo: no, 2.1_rc22 was a thing
(21:22:31) cron2: mattock: release candidates come before 2.1.0 :-)
(21:22:33) dazo: 2.1.4 was the last release
(21:22:50) cron2: commit 1852709cd5093995f97ba4860d1a6083c6df6d6c (tag: 
v2.1_rc22)
(21:23:10) cron2: anyway
(21:23:13) mattock: yes of course, but 2.0-rc18 was the biggest achievement in 
RCs so far
(21:23:23) mattock: but yeah
(21:23:30) mattock: I propose "mid next week" for rc2
(21:23:31) cron2: mattock: uh - no?  2.1_rc22 is more than 2.0_rc18?
(21:23:35) dazo: mattock: you're awake?  22 comes after 18 ;-)
(21:23:44) mattock: where do you guys see 2.1_Rc22?
(21:23:49) mattock: not on build.openvpn.net?
(21:23:55) dazo:  git tag -l | grep v2.1_rc
(21:23:58) mattock: ok
(21:24:00) cron2: in the commit quoted above
(21:24:03) mattock: I withdraw my objections
(21:24:10) mattock: that's pretty incredible
(21:24:13) cron2: not sure what release had the most versions actually built 
and published :-)

[Openvpn-devel] [PATCH] Alias ADAPTER_DOMAIN_SUFFIX to DOMAIN

2020-09-24 Thread Lev Stipakov
From: Lev Stipakov 

ADAPTER_DOMAIN_SUFFIX is an openvpn3 replacement for
DOMAIN, which is used there for split-dns. This is pushed by
modern Access Server.

This change improves compatibility between OpenVPN
community client and Access Server.

Signed-off-by: Lev Stipakov 
---
 doc/man-sections/vpn-network-options.rst |  3 +++
 src/openvpn/options.c| 21 +++--
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/doc/man-sections/vpn-network-options.rst 
b/doc/man-sections/vpn-network-options.rst
index 825dd1ca..dbc51e6c 100644
--- a/doc/man-sections/vpn-network-options.rst
+++ b/doc/man-sections/vpn-network-options.rst
@@ -114,6 +114,9 @@ routing.
   :code:`DOMAIN` ``name``
 Set Connection-specific DNS Suffix to :code:`name`.
 
+  :code:`ADAPTER_DOMAIN_SUFFIX` ``name``
+Set Connection-specific DNS Suffix to :code:`name`.
+
   :code:`DOMAIN-SEARCH` ``name``
 Add :code:`name` to the domain search list.
 Repeat this option to add more entries. Up to
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 4b22d3d9..bcff0611 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -715,16 +715,17 @@ static const char usage_message[] =
 "be used with --ip-win32 dynamic.  For options\n"
 "which allow multiple addresses,\n"
 "--dhcp-option must be repeated.\n"
-"DOMAIN name : Set DNS suffix\n"
+"DOMAIN name : Set DNS suffix\n"
+"ADAPTER_DOMAIN_NAME : alias to DOMAIN\n"
 "DOMAIN-SEARCH entry : Add entry to DNS domain search 
list\n"
-"DNS addr: Set domain name server address(es) 
(IPv4 and IPv6)\n"
-"NTP : Set NTP server address(es)\n"
-"NBDD: Set NBDD server address(es)\n"
-"WINS addr   : Set WINS server address(es)\n"
-"NBT type: Set NetBIOS over TCP/IP Node type\n"
-"  1: B, 2: P, 4: M, 8: H\n"
-"NBS id  : Set NetBIOS scope ID\n"
-"DISABLE-NBT : Disable Netbios-over-TCP/IP.\n"
+"DNS addr: Set domain name server 
address(es) (IPv4 and IPv6)\n"
+"NTP : Set NTP server address(es)\n"
+"NBDD: Set NBDD server address(es)\n"
+"WINS addr   : Set WINS server address(es)\n"
+"NBT type: Set NetBIOS over TCP/IP Node 
type\n"
+"  1: B, 2: P, 4: M, 8: H\n"
+"NBS id  : Set NetBIOS scope ID\n"
+"DISABLE-NBT : Disable Netbios-over-TCP/IP.\n"
 "--dhcp-renew   : Ask Windows to renew the TAP adapter lease on 
startup.\n"
 "--dhcp-pre-release : Ask Windows to release the previous TAP adapter 
lease on\n"
 "   startup.\n"
@@ -7440,7 +7441,7 @@ add_option(struct options *options,
 VERIFY_PERMISSION(OPT_P_IPWIN32);
 bool ipv6dns = false;
 
-if (streq(p[1], "DOMAIN") && p[2])
+if ((streq(p[1], "DOMAIN") || streq(p[1], "ADAPTER_DOMAIN_SUFFIX")) && 
p[2])
 {
 o->domain = p[2];
 }
-- 
2.17.1



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: openvpnmsica: Simplify find_adapters() to void return

2020-09-24 Thread Gert Doering
Indeed, that looks simple and straightforward :-) - compile
tested on MinGW.

Your patch has been applied to the master and release/2.5 branch.

commit 7f7b05395c3eb634e198d12e212360958c3ca8fb (master)
commit 29e61986af6bfe4ca41163c4a1c74d90b1b0bdea (release/2.5)
Author: Simon Rozman via Openvpn-devel
Date:   Thu Sep 24 08:55:19 2020 +0200

 openvpnmsica: Simplify find_adapters() to void return

 Signed-off-by: Simon Rozman 
 Acked-by: Lev Stipakov 
 Message-Id: <20200924065519.1839-1-si...@rozman.si>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21077.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: netsh: Delete WINS servers on TUN close

2020-09-24 Thread Gert Doering
Your patch has been applied to the master and release/2.5 branch.

I have not tested this at all (no WINS infra), but "it looks 
reasonable and compiles" (Ubuntu 18, mingw).

commit 370395b3348c4307cdea955abaa36ba315cc128e (master)
commit b77fc7121003d988eaa3eaeef2ec46bff73202cf (release/2.5)
Author: Simon Rozman via Openvpn-devel
Date:   Thu Sep 24 08:44:52 2020 +0200

 netsh: Delete WINS servers on TUN close

 Signed-off-by: Simon Rozman 
 Acked-by: Lev Stipakov 
 Message-Id: <20200924064452.1001-3-si...@rozman.si>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21075.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: netsh: Clear existing IPv6 DNS servers before configuring new ones

2020-09-24 Thread Gert Doering
Your patch has been applied to the master and release/2.5 branch.

In my win7 tests this does not seem to be *needed* - I ran a test
with an IPv6 DNS server, and then the same test without, and the
"ipconfig /all" output showed "no more IPv6 DNS server" (before
applying this patch) - but this might have an effect if no IPv4 
servers are there.  

I was a bit worried that this might break in the "ip-win32 netsh" case,
so I tested that one as well.  It seems to do the right thing, though,
decoupling IPv4 DNS servers and IPv6 DNS servers (and not deleting
"just all" with the delete command).

Incidentially I tested "netsh interface ip set address 17 dhcp" here
as well (works).

commit dd754221024cf60226ebaa679ec65ccc23f4e402 (master)
commit 77c62003c263304f8b411d664cf56179f8d4df08 (release/2.5)
Author: Simon Rozman via Openvpn-devel
Date:   Thu Sep 24 08:44:51 2020 +0200

 netsh: Clear existing IPv6 DNS servers before configuring new ones

 Signed-off-by: Simon Rozman 
 Acked-by: Lev Stipakov 
 Message-Id: <20200924064452.1001-2-si...@rozman.si>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21078.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: netsh: Specify interfaces by index rather than name

2020-09-24 Thread Gert Doering
This patch is good and a useful change (I have stared-at-code and
it make sense, and Lev has reviewed and tested it on Win10/MSVC).

I have test compiled this in MinGW on Ubuntu 18.04 and tested IPv6 route
installation/removal on Win7/64 with the GUI running as Administrator
(= netsh commands used, not iservice) and it is also doing the right
things.  I have tested "ipv6 ifconfig", "ipv6 route" and "ipv6 DNS",
but not "IPv4 configs" or "enable DHCP".


At this point in the release cycle I would normally have not 
included it into release/2.5 anymore - we're trying to eventually 
reach a release, and not merge refactoring things anymore - *but* 
since this is well-contained, and 2/3+3/3 are actual bugfixes that 
sort of need this as prerequisite, so be it.

Let's see if we beat the number of release candidates 2.1 had... :-)

Your patch has been applied to the master and release/2.5 branch.

commit 6020e94bcf9eda89aa6573cb2eb1faf6d267cb46 (master)
commit 422343040f137cf970aea0cf8f1f248d5dc50b9d (release/2.5)
Author: Simon Rozman via Openvpn-devel
Date:   Thu Sep 24 08:44:50 2020 +0200

 netsh: Specify interfaces by index rather than name

 Signed-off-by: Simon Rozman 
 Acked-by: Lev Stipakov 
 Message-Id: <20200924064452.1001-1-si...@rozman.si>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21076.html
 Signed-off-by: Gert Doering 

--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH] openvpnmsica: Skip legacy TAP-Windows6 adapters from evaluation

2020-09-24 Thread Lev Stipakov
Hi,

> Legacy TAP-Windows6 adapters (marked as IF_TYPE_ETHERNET_CSMACD 0x6)
> fail to upgrade to the new driver on Windows 7: Device cannot start
> (Code 10).

Does "legacy" adapter mean the one which was built before
https://github.com/OpenVPN/tap-windows6/commit/c869bc91c2537868d012af6cf833889420350387
(merged in 10/2019) ?

I just installed 2.4.6 (released in 04/2018) on Windows 7 and upgraded
it to 2.5rc1 without any issues.

Am I missing something? Also, is it supposed to be only Windows 7 specific?

> +OSVERSIONINFOEX osvi = { sizeof(OSVERSIONINFOEX), 
> HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8) };
> +DWORDLONG const dwlConditionMask = 
> VerSetConditionMask(VerSetConditionMask(0, VER_MAJORVERSION, 
> VER_GREATER_EQUAL), VER_MINORVERSION, VER_GREATER_EQUAL);
> +BOOL bSkipLegacyAdapters = !VerifyVersionInfo(, VER_MAJORVERSION | 
> VER_MINORVERSION, dwlConditionMask);

Cannot we use IsWindows7OrGreater() ? It should work even though
msiexec is not manifested.

> +if (CM_Get_DevNode_Status(>ulStatus, >ulProblemNumber, 
> devinfo_data.DevInst, 0) != CR_SUCCESS)
> +{
> +node->ulStatus = 0;
> +node->ulProblemNumber = 0;
> +}

Is this change related to the bug we're supposingly fixing? What does
it do, why is it needed?

-- 
-Lev


___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH] openvpnmsica: Simplify find_adapters() to void return

2020-09-24 Thread Lev Stipakov
Hi,

> to return result code. It still logs any error thou.

though

> -static UINT
> +static void

Indeed, the return value of find_adapters() has never been used.

Compiled with MSVC.

Acked-by: Lev Stipakov 


___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH 3/3] netsh: Delete WINS servers on TUN close

2020-09-24 Thread Lev Stipakov
Hi,

> +"%s%s interface ipv4 delete winsservers %lu all",

For DNS we use "dns", so it would be nice to unify it - either use
dnsservers/winsservers or dns/wins. But that could be done later.

Code makes sense, compiled/tested on MSVC/Win10.

Acked-by: Lev Stipakov 


___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH v6 1/2] Selectively reformat too long lines

2020-09-24 Thread Vladislav Grishenko
Hi Antonio,

 

Here's I have aligned the last line to add next new proto, already aligned.

Yes, you’re right “UDPv6” also needs to be aligned, and space needs to be added 
for all lines, thank you.

V7 is sent

 



 

--

Best Regards, Vladislav Grishenko

 

> -Original Message-

> From: Antonio Quartulli 

> Sent: Thursday, September 24, 2020 1:12 PM

> To: Vladislav Grishenko ; openvpn-

> de...@lists.sourceforge.net

> Subject: Re: [Openvpn-devel] [PATCH v6 1/2] Selectively reformat too long 
> lines

> 

> Hi,

> 

> On 20/09/2020 22:57, Vladislav Grishenko wrote:

> > @@ -3170,7 +3179,7 @@ static const struct proto_names proto_names[] = {

> >  {"udp6","UDPv6", AF_INET6, PROTO_UDP},

> >  {"tcp6-server","TCPv6_SERVER", AF_INET6, PROTO_TCP_SERVER},

> >  {"tcp6-client","TCPv6_CLIENT", AF_INET6, PROTO_TCP_CLIENT},

> > -{"tcp6","TCPv6", AF_INET6, PROTO_TCP},

> > +{"tcp6",   "TCPv6", AF_INET6, PROTO_TCP},

> 

> What are you actually fixing here? Adding a tab?

> I feel there should be a space after each ',', but that is probably out of 
> the scope

> of this patch?

> 

> 

> --

> Antonio Quartulli

___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH v7] Selectively reformat too long lines

2020-09-24 Thread Vladislav Grishenko
Per https://community.openvpn.net/openvpn/wiki/CodeStyle the maximum line
length is 80 characters. This patch allows to split upcoming changes into
CodeStyle-conformant (w/o real code change) and more feature-specific.
Upcoming changes adds new PROTO_AUTO, so existing proto_names array is
reformatted as well.

v7: prefer line breaks before long string parameters
reformat proto_names array

Signed-off-by: Vladislav Grishenko 
---
 src/openvpn/init.c|  3 +-
 src/openvpn/options.c | 80 +--
 src/openvpn/socket.c  | 52 +---
 3 files changed, 89 insertions(+), 46 deletions(-)

diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index d1ad5c8f..31ecadcc 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -3646,7 +3646,8 @@ do_close_link_socket(struct context *c)
   && ( (c->options.persist_remote_ip)
||
( c->sig->source != SIG_SOURCE_HARD
- && ((c->c1.link_socket_addr.current_remote && 
c->c1.link_socket_addr.current_remote->ai_next)
+ && ((c->c1.link_socket_addr.current_remote
+  && c->c1.link_socket_addr.current_remote->ai_next)
  || c->options.no_advance))
)))
 {
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 4b22d3d9..92f446e7 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -1983,7 +1983,8 @@ connection_entry_load_re(struct connection_entry *ce, 
const struct remote_entry
 }
 
 static void
-options_postprocess_verify_ce(const struct options *options, const struct 
connection_entry *ce)
+options_postprocess_verify_ce(const struct options *options,
+  const struct connection_entry *ce)
 {
 struct options defaults;
 int dev = DEV_TYPE_UNDEF;
@@ -2011,7 +2012,9 @@ options_postprocess_verify_ce(const struct options 
*options, const struct connec
  */
 if (ce->proto == PROTO_TCP)
 {
-msg(M_USAGE, "--proto tcp is ambiguous in this context.  Please 
specify --proto tcp-server or --proto tcp-client");
+msg(M_USAGE,
+"--proto tcp is ambiguous in this context. Please specify "
+"--proto tcp-server or --proto tcp-client");
 }
 
 /*
@@ -2051,8 +2054,9 @@ options_postprocess_verify_ce(const struct options 
*options, const struct connec
 
 if (options->inetd)
 {
-msg(M_WARN, "DEPRECATED OPTION: --inetd mode is deprecated "
-"and will be removed in OpenVPN 2.6");
+msg(M_WARN,
+"DEPRECATED OPTION: --inetd mode is deprecated and will be removed 
"
+"in OpenVPN 2.6");
 }
 
 if (options->lladdr && dev != DEV_TYPE_TAP)
@@ -2065,7 +2069,9 @@ options_postprocess_verify_ce(const struct options 
*options, const struct connec
  */
 if (options->ce.tun_mtu_defined && options->ce.link_mtu_defined)
 {
-msg(M_USAGE, "only one of --tun-mtu or --link-mtu may be defined (note 
that --ifconfig implies --link-mtu %d)", LINK_MTU_DEFAULT);
+msg(M_USAGE,
+"only one of --tun-mtu or --link-mtu may be defined (note that "
+"--ifconfig implies --link-mtu %d)", LINK_MTU_DEFAULT);
 }
 
 if (!proto_is_udp(ce->proto) && options->mtu_test)
@@ -2092,18 +2098,23 @@ options_postprocess_verify_ce(const struct options 
*options, const struct connec
 if (string_defined_equal(ce->remote, options->ifconfig_local)
 || string_defined_equal(ce->remote, options->ifconfig_remote_netmask))
 {
-msg(M_USAGE, "--local and --remote addresses must be distinct from 
--ifconfig addresses");
+msg(M_USAGE,
+"--local and --remote addresses must be distinct from --ifconfig "
+"addresses");
 }
 
 if (string_defined_equal(ce->local, options->ifconfig_local)
 || string_defined_equal(ce->local, options->ifconfig_remote_netmask))
 {
-msg(M_USAGE, "--local addresses must be distinct from --ifconfig 
addresses");
+msg(M_USAGE,
+"--local addresses must be distinct from --ifconfig addresses");
 }
 
-if (string_defined_equal(options->ifconfig_local, 
options->ifconfig_remote_netmask))
+if (string_defined_equal(options->ifconfig_local,
+ options->ifconfig_remote_netmask))
 {
-msg(M_USAGE, "local and remote/netmask --ifconfig addresses must be 
different");
+msg(M_USAGE,
+"local and remote/netmask --ifconfig addresses must be different");
 }
 
 if (ce->bind_defined && !ce->bind_local)
@@ -2113,12 +2124,14 @@ options_postprocess_verify_ce(const struct options 
*options, const struct connec
 
 if (ce->local && !ce->bind_local)
 {
-msg(M_USAGE, "--local and --nobind don't make sense when used 
together");
+msg(M_USAGE,
+"--local and --nobind don't make sense when used together");
 }
 
 if 

Re: [Openvpn-devel] [PATCH 2/3] netsh: Clear existing IPv6 DNS servers before configuring new ones

2020-09-24 Thread Lev Stipakov
Hi,

> When there are no IPv6 DNS published, the adapter state is not
> sanitized and might contain IPv6 DNS server from a previous session.

In this case, shouldn't the "set dns" call below overwrite the previous value?

> netsh_ifconfig_options() clears DNS servers for IPv4 already.

Agreed, let's do it for consistency.

>   * The list of dns servers currently set on the interface
>   * are cleared first.

Either existing comment lied or "implicit clear" was assumed because
of the "set dns" call.
But now it is fine, since we have real clearing.

Stared and the code, built and tested on MSVC/Win10.

Acked-by: Lev Stipakov 


___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH v6 1/2] Selectively reformat too long lines

2020-09-24 Thread Antonio Quartulli
Hi,

On 20/09/2020 22:57, Vladislav Grishenko wrote:
> @@ -3170,7 +3179,7 @@ static const struct proto_names proto_names[] = {
>  {"udp6","UDPv6", AF_INET6, PROTO_UDP},
>  {"tcp6-server","TCPv6_SERVER", AF_INET6, PROTO_TCP_SERVER},
>  {"tcp6-client","TCPv6_CLIENT", AF_INET6, PROTO_TCP_CLIENT},
> -{"tcp6","TCPv6", AF_INET6, PROTO_TCP},
> +{"tcp6",   "TCPv6", AF_INET6, PROTO_TCP},

What are you actually fixing here? Adding a tab?
I feel there should be a space after each ',', but that is probably out
of the scope of this patch?


-- 
Antonio Quartulli


___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH 1/3] netsh: Specify interfaces by index rather than name

2020-09-24 Thread Lev Stipakov
Good old "name vs index" thing.

According to "man" of netsh, index indeed could be used for "set
address" and "add route":

> interface - Interface name or index.

> +DWORD adapter_index;
>  if (r6->adapter_index)  /* vpn server special route */
>  {
> -buf_printf(, "interface=%lu", r6->adapter_index );
> +adapter_index = r6->adapter_index;
>  gateway_needed = true;
>  }
>  else
>  {
> -buf_printf(, "interface=%lu", tt->adapter_index );
> +adapter_index = tt->adapter_index;
>  }

Here I would do something like

  DWORD adapter_index = tt->adapter_index;
  if (r6->adapter_index)
  {
  adapter_index = r6->adapter_index;
  gateway_needed = true;
  }

to make code more concise, but I am fine with current implementation too.

Stared at the code, built and tested on MSVC/Win10. Works as expected.

Acked-by: Lev Stipakov 


___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH] openvpnmsica: Skip legacy TAP-Windows6 adapters from evaluation

2020-09-24 Thread Simon Rozman via Openvpn-devel
Legacy TAP-Windows6 adapters (marked as IF_TYPE_ETHERNET_CSMACD 0x6)
fail to upgrade to the new driver on Windows 7: Device cannot start
(Code 10).

Ignoring those adapters on Windows 7 triggers creation of a new TAP
adapter on setup eliminating the need for user intervention.

Signed-off-by: Simon Rozman 
---
 src/openvpnmsica/openvpnmsica.c | 13 
 src/tapctl/tap.c| 37 +
 src/tapctl/tap.h|  3 +++
 3 files changed, 49 insertions(+), 4 deletions(-)

diff --git a/src/openvpnmsica/openvpnmsica.c b/src/openvpnmsica/openvpnmsica.c
index f203f736..dd6ecd74 100644
--- a/src/openvpnmsica/openvpnmsica.c
+++ b/src/openvpnmsica/openvpnmsica.c
@@ -303,10 +303,18 @@ find_adapters(
 }
 }
 
+OSVERSIONINFOEX osvi = { sizeof(OSVERSIONINFOEX), 
HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8) };
+DWORDLONG const dwlConditionMask = 
VerSetConditionMask(VerSetConditionMask(0, VER_MAJORVERSION, 
VER_GREATER_EQUAL), VER_MINORVERSION, VER_GREATER_EQUAL);
+BOOL bSkipLegacyAdapters = !VerifyVersionInfo(, VER_MAJORVERSION | 
VER_MINORVERSION, dwlConditionMask);
+
 /* Count adapters. */
 size_t adapter_count = 0;
 for (struct tap_adapter_node *pAdapter = pAdapterList; pAdapter; pAdapter 
= pAdapter->pNext)
 {
+if (bSkipLegacyAdapters && pAdapter->dwIfType != IF_TYPE_PROP_VIRTUAL)
+{
+continue;
+}
 adapter_count++;
 }
 
@@ -331,6 +339,11 @@ find_adapters(
 
 for (struct tap_adapter_node *pAdapter = pAdapterList; pAdapter; pAdapter 
= pAdapter->pNext)
 {
+if (bSkipLegacyAdapters && pAdapter->dwIfType != IF_TYPE_PROP_VIRTUAL)
+{
+continue;
+}
+
 /* Convert adapter GUID to UTF-16 string. (LPOLESTR defaults to 
LPWSTR) */
 LPOLESTR szAdapterId = NULL;
 StringFromIID((REFIID)>guid, );
diff --git a/src/tapctl/tap.c b/src/tapctl/tap.c
index dd4a10a3..0dfc7555 100644
--- a/src/tapctl/tap.c
+++ b/src/tapctl/tap.c
@@ -29,6 +29,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -551,6 +552,8 @@ get_reg_string(
  *
  * @param pguidAdapter  A pointer to GUID that receives network adapter ID.
  *
+ * @param pdwIfType A pointer to DWORD that receives interface type.
+ *
  * @return ERROR_SUCCESS on success; Win32 error code otherwise
  **/
 static DWORD
@@ -558,7 +561,8 @@ get_net_adapter_guid(
 _In_ HDEVINFO hDeviceInfoSet,
 _In_ PSP_DEVINFO_DATA pDeviceInfoData,
 _In_ int iNumAttempts,
-_Out_ LPGUID pguidAdapter)
+_Out_ LPGUID pguidAdapter,
+_Out_opt_ LPDWORD pdwIfType)
 {
 DWORD dwResult = ERROR_BAD_ARGUMENTS;
 
@@ -613,6 +617,23 @@ get_net_adapter_guid(
 
 dwResult = SUCCEEDED(CLSIDFromString(szCfgGuidString, 
(LPCLSID)pguidAdapter)) ? ERROR_SUCCESS : ERROR_INVALID_DATA;
 free(szCfgGuidString);
+
+if (pdwIfType)
+{
+DWORD dwValueType = REG_NONE, dwSize = sizeof(*pdwIfType);
+dwResult = RegQueryValueEx(
+hKey,
+TEXT("*IfType"),
+NULL,
+,
+(BYTE *)pdwIfType,
+);
+if (dwResult != ERROR_SUCCESS || dwValueType != REG_DWORD || 
dwSize != sizeof(*pdwIfType))
+{
+*pdwIfType = IF_TYPE_OTHER;
+}
+}
+
 break;
 }
 
@@ -839,7 +860,7 @@ tap_create_adapter(
 }
 
 /* Get network adapter ID from registry. Retry for max 30sec. */
-dwResult = get_net_adapter_guid(hDevInfoList, _data, 30, 
pguidAdapter);
+dwResult = get_net_adapter_guid(hDevInfoList, _data, 30, 
pguidAdapter, NULL);
 
 cleanup_remove_device:
 if (dwResult != ERROR_SUCCESS)
@@ -981,7 +1002,7 @@ execute_on_first_adapter(
 
 /* Get adapter GUID. */
 GUID guidAdapter;
-dwResult = get_net_adapter_guid(hDevInfoList, _data, 1, 
);
+dwResult = get_net_adapter_guid(hDevInfoList, _data, 1, 
, NULL);
 if (dwResult != ERROR_SUCCESS)
 {
 /* Something is wrong with this device. Skip it. */
@@ -1259,7 +1280,8 @@ tap_list_adapters(
 
 /* Get adapter GUID. */
 GUID guidAdapter;
-dwResult = get_net_adapter_guid(hDevInfoList, _data, 1, 
);
+DWORD dwIfType;
+dwResult = get_net_adapter_guid(hDevInfoList, _data, 1, 
, );
 if (dwResult != ERROR_SUCCESS)
 {
 /* Something is wrong with this device. Skip it. */
@@ -1321,6 +1343,7 @@ tap_list_adapters(
 memcpy(node->szzHardwareIDs, szzDeviceHardwareIDs, hwid_size);
 node->szName = (LPTSTR)((LPBYTE)node->szzHardwareIDs + hwid_size);
 memcpy(node->szName, szName, name_size);
+node->dwIfType = dwIfType;
 node->pNext = NULL;
 if (pAdapterTail)
 {
@@ -1332,6 +1355,12 @@ tap_list_adapters(
 *ppAdapter = pAdapterTail = node;
 }
 
+if 

[Openvpn-devel] [PATCH 2/3] netsh: Clear existing IPv6 DNS servers before configuring new ones

2020-09-24 Thread Simon Rozman via Openvpn-devel
When there are no IPv6 DNS published, the adapter state is not
sanitized and might contain IPv6 DNS server from a previous session.

netsh_ifconfig_options() clears DNS servers for IPv4 already.

Signed-off-by: Simon Rozman 
---
 src/openvpn/tun.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 8fd3229f..b1cd7a1b 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -5281,7 +5281,6 @@ ip_addr_member_of(const in_addr_t addr, const 
IP_ADDR_STRING *ias)
  * Set the ipv6 dns servers on the specified interface.
  * The list of dns servers currently set on the interface
  * are cleared first.
- * No action is taken if number of addresses (addr_len) < 1.
  */
 static void
 netsh_set_dns6_servers(const struct in6_addr *addr_list,
@@ -5291,6 +5290,13 @@ netsh_set_dns6_servers(const struct in6_addr *addr_list,
 struct gc_arena gc = gc_new();
 struct argv argv = argv_new();
 
+/* delete existing DNS settings from TAP interface */
+argv_printf(, "%s%s interface ipv6 delete dns %lu all",
+get_win_sys_path(),
+NETSH_PATH_SUFFIX,
+adapter_index);
+netsh_command(, 2, M_FATAL);
+
 for (int i = 0; i < addr_len; ++i)
 {
 const char *fmt = (i == 0) ?
-- 
2.28.0.windows.1



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH] openvpnmsica: Simplify find_adapters() to void return

2020-09-24 Thread Simon Rozman via Openvpn-devel
As the find_adapters() failure is not critical and FindSystemInfo()
should continue regardless, the find_adapters() has been simplified not
to return result code. It still logs any error thou.

Signed-off-by: Simon Rozman 
---
 src/openvpnmsica/openvpnmsica.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/openvpnmsica/openvpnmsica.c b/src/openvpnmsica/openvpnmsica.c
index f203f736..de1cf65c 100644
--- a/src/openvpnmsica/openvpnmsica.c
+++ b/src/openvpnmsica/openvpnmsica.c
@@ -248,7 +248,7 @@ cleanup_OpenSCManager:
 }
 
 
-static UINT
+static void
 find_adapters(
 _In_ MSIHANDLE hInstall,
 _In_z_ LPCTSTR szzHardwareIDs,
@@ -262,12 +262,12 @@ find_adapters(
 uiResult = tap_list_adapters(NULL, szzHardwareIDs, );
 if (uiResult != ERROR_SUCCESS)
 {
-return uiResult;
+return;
 }
 else if (pAdapterList == NULL)
 {
 /* No adapters - no fun. */
-return ERROR_SUCCESS;
+return;
 }
 
 /* Get IPv4/v6 info for all network adapters. Actually, we're interested 
in link status only: up/down? */
@@ -394,7 +394,6 @@ cleanup_pAdapterAdresses:
 free(pAdapterAdresses);
 cleanup_pAdapterList:
 tap_free_adapter_list(pAdapterList);
-return uiResult;
 }
 
 
-- 
2.28.0.windows.1



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH 1/3] netsh: Specify interfaces by index rather than name

2020-09-24 Thread Simon Rozman via Openvpn-devel
This is more efficient and less error prone.

Signed-off-by: Simon Rozman 
---
 src/openvpn/route.c | 26 +++---
 src/openvpn/tun.c   | 88 +
 2 files changed, 53 insertions(+), 61 deletions(-)

diff --git a/src/openvpn/route.c b/src/openvpn/route.c
index bd6b968b..d75aa5f4 100644
--- a/src/openvpn/route.c
+++ b/src/openvpn/route.c
@@ -1987,25 +1987,24 @@ add_route_ipv6(struct route_ipv6 *r6, const struct 
tuntap *tt,
 }
 else
 {
-struct buffer out = alloc_buf_gc(64, );
+DWORD adapter_index;
 if (r6->adapter_index)  /* vpn server special route */
 {
-buf_printf(, "interface=%lu", r6->adapter_index );
+adapter_index = r6->adapter_index;
 gateway_needed = true;
 }
 else
 {
-buf_printf(, "interface=%lu", tt->adapter_index );
+adapter_index = tt->adapter_index;
 }
-device = buf_bptr();
 
-/* netsh interface ipv6 add route 2001:db8::/32 MyTunDevice */
-argv_printf(, "%s%s interface ipv6 add route %s/%d %s",
+/* netsh interface ipv6 add route 2001:db8::/32 42 */
+argv_printf(, "%s%s interface ipv6 add route %s/%d %lu",
 get_win_sys_path(),
 NETSH_PATH_SUFFIX,
 network,
 r6->netbits,
-device);
+adapter_index);
 
 /* next-hop depends on TUN or TAP mode:
  * - in TAP mode, we use the "real" next-hop
@@ -2431,25 +2430,24 @@ delete_route_ipv6(const struct route_ipv6 *r6, const 
struct tuntap *tt,
 }
 else
 {
-struct buffer out = alloc_buf_gc(64, );
+DWORD adapter_index;
 if (r6->adapter_index)  /* vpn server special route */
 {
-buf_printf(, "interface=%lu", r6->adapter_index );
+adapter_index = r6->adapter_index;
 gateway_needed = true;
 }
 else
 {
-buf_printf(, "interface=%lu", tt->adapter_index );
+adapter_index = tt->adapter_index;
 }
-device = buf_bptr();
 
-/* netsh interface ipv6 delete route 2001:db8::/32 MyTunDevice */
-argv_printf(, "%s%s interface ipv6 delete route %s/%d %s",
+/* netsh interface ipv6 delete route 2001:db8::/32 42 */
+argv_printf(, "%s%s interface ipv6 delete route %s/%d %lu",
 get_win_sys_path(),
 NETSH_PATH_SUFFIX,
 network,
 r6->netbits,
-device);
+adapter_index);
 
 /* next-hop depends on TUN or TAP mode:
  * - in TAP mode, we use the "real" next-hop
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index faa02504..8fd3229f 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -68,7 +68,7 @@ const static GUID GUID_DEVINTERFACE_NET = { 0xcac88484, 
0x7515, 0x4c03, { 0x82,
 #define NI_OPTIONS (1<<2)
 
 static void netsh_ifconfig(const struct tuntap_options *to,
-   const char *flex_name,
+   DWORD adapter_index,
const in_addr_t ip,
const in_addr_t netmask,
const unsigned int flags);
@@ -79,7 +79,7 @@ static void windows_set_mtu(const int iface_index,
 
 static void netsh_set_dns6_servers(const struct in6_addr *addr_list,
const int addr_len,
-   const char *flex_name);
+   DWORD adapter_index);
 
 static void netsh_command(const struct argv *a, int n, int msglevel);
 
@@ -1103,10 +1103,9 @@ do_ifconfig_ipv6(struct tuntap *tt, const char *ifname, 
int tun_mtu,
 }
 else
 {
-/* example: netsh interface ipv6 set address interface=42
+/* example: netsh interface ipv6 set address 42
  *  2001:608:8003::d/bits store=active
  */
-char iface[64];
 
 /* in TUN mode, we only simulate a subnet, so the interface
  * is configured with /128 + a route to fe80::8.  In TAP mode,
@@ -1114,10 +1113,8 @@ do_ifconfig_ipv6(struct tuntap *tt, const char *ifname, 
int tun_mtu,
  */
 int netbits = (tt->type == DEV_TYPE_TUN) ? 128 : tt->netbits_ipv6;
 
-openvpn_snprintf(iface, sizeof(iface), "interface=%lu",
- tt->adapter_index);
-argv_printf(, "%s%s interface ipv6 set address %s %s/%d 
store=active",
-get_win_sys_path(), NETSH_PATH_SUFFIX, iface,
+argv_printf(, "%s%s interface ipv6 set address %lu %s/%d 
store=active",
+get_win_sys_path(), NETSH_PATH_SUFFIX, tt->adapter_index,
 ifconfig_ipv6_local, netbits);
 netsh_command(, 4, M_FATAL);
 if (tt->type == DEV_TYPE_TUN)
@@ -1125,7 

[Openvpn-devel] [PATCH 3/3] netsh: Delete WINS servers on TUN close

2020-09-24 Thread Simon Rozman via Openvpn-devel
Signed-off-by: Simon Rozman 
---
 src/openvpn/tun.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index b1cd7a1b..80ae6958 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -6706,6 +6706,16 @@ netsh_delete_address_dns(const struct tuntap *tt, bool 
ipv6, struct gc_arena *gc
 netsh_command(, 1, M_WARN);
 }
 
+if (!ipv6 && tt->options.wins_len > 0)
+{
+argv_printf(,
+"%s%s interface ipv4 delete winsservers %lu all",
+get_win_sys_path(),
+NETSH_PATH_SUFFIX,
+tt->adapter_index);
+netsh_command(, 1, M_WARN);
+}
+
 if (ipv6 && tt->type == DEV_TYPE_TUN)
 {
 delete_route_connected_v6_net(tt);
-- 
2.28.0.windows.1



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel