mbox series

[Openvpn-devel,0/2] Couple of fixes

Message ID 20200205124615.15758-1-domagoj@pensa.hr
Headers show
Series Couple of fixes | expand

Message

Domagoj Pensa Feb. 5, 2020, 1:46 a.m. UTC
Hi!

First patch fixes long delays when setting IPv4 DNS using netsh without 
interactive service by adding "validate=no" to netsh invocation.

I've noticed that issue while testing wintun, as it is setup using netsh.

All other variants, IPv6 DNS without interactive service and IPv4/IPv6 DNS 
with interactive service, have validation already turned off.

Change is adapted from code by commit 786e06a.
It is necessary to make sure that argument is added only for DNS and not 
WINS, thus additional check is made (is_dns).

Second patch was necessary, at least for me, because build process was 
unable to perform linking, with the following output:

/usr/bin/x86_64-w64-mingw32-ld: forward.o:forward.c:(.text+0x5fec): 
undefined reference to `tuntap_is_wintun'
/usr/bin/x86_64-w64-mingw32-ld: mtcp.o:mtcp.c:(.text+0x8a4): undefined reference to `tuntap_is_wintun'
/usr/bin/x86_64-w64-mingw32-ld: mtcp.o:mtcp.c:(.text+0x1362): undefined reference to `tuntap_is_wintun'
/usr/bin/x86_64-w64-mingw32-ld: mtcp.o:mtcp.c:(.text+0x1379): undefined reference to `tuntap_ring_empty'
/usr/bin/x86_64-w64-mingw32-ld: mudp.o:mudp.c:(.text+0x536): undefined reference to `tuntap_is_wintun'
/usr/bin/x86_64-w64-mingw32-ld: mudp.o:mudp.c:(.text+0xf53): undefined reference to `tuntap_ring_empty'
/usr/bin/x86_64-w64-mingw32-ld: openvpn.o:openvpn.c:(.text+0x1b6): undefined reference to `tuntap_ring_empty'
/usr/bin/x86_64-w64-mingw32-ld: openvpn.o:openvpn.c:(.text+0x261): undefined reference to `tuntap_is_wintun'
collect2: error: ld returned 1 exit status

After declaring both functions as static linking worked.

I'm using Ubuntu 19.04 with mingw-w64 from official repository (version 
6.0.0-3) and for build process script generic/build from openvpn-build 
repository.

It is also worth noting that similar function tuntap_defined() with same 
signature (static inline bool) already exists in the same header file, so 
this change should be safe.

Domagoj Pensa (2):
  Skip DNS address validation
  Fix linking issues on MinGW

 src/openvpn/tun.c | 9 +++++++++
 src/openvpn/tun.h | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)