Re: [Openvpn-devel] [PATCHv2] Handle DNS6 option on Android

2016-11-22 Thread Gert Doering
Hi,

On Tue, Nov 22, 2016 at 11:33:36AM -0500, Selva Nair wrote:
> The code looks good to me, so ACK

Beat you to it :)

> (Note: the preferred comment closing style may be '*/' on a line by
> itself?).

Indeed it is.  I overlooked that, otherwise I would have fixed it on
the fly.  Meh.

gert

-- 
USENET is *not* the non-clickable part of WWW!
   //www.muc.de/~gert/
Gert Doering - Munich, Germany g...@greenie.muc.de
fax: +49-89-35655025g...@net.informatik.tu-muenchen.de


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


Re: [Openvpn-devel] [PATCHv2] Handle DNS6 option on Android

2016-11-22 Thread Selva Nair
Hi,
On Tue, Nov 22, 2016 at 6:38 AM, Arne Schwabe  wrote:
...


> -  for (i = 0; i < tt->options.dns_len; ++i) {
> +  /* Prefer IPv6 DNS servers,
> +   * Android will use the DNS server in the order we specify*/
> +  for (int i = 0; i < tt->options.dns6_len; i++) {
> +management_android_control (management, "DNS6SERVER",
> +   print_in6_addr (tt->options.dns6[i], 0,
> ));
> +  }
> +
> +  for (int i = 0; i < tt->options.dns_len; i++) {
>  management_android_control (management, "DNSSERVER",
> print_in_addr_t(tt->options.dns[i], 0,
> ));
>}


The code looks good to me, so ACK
(Note: the preferred comment closing style may be '*/' on a line by
itself?).

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


[Openvpn-devel] [PATCHv2] Handle DNS6 option on Android

2016-11-22 Thread Arne Schwabe
Patch V2: Prefer IPv6 DNS servers
---
 doc/android.txt   |  3 ++-
 src/openvpn/tun.c | 10 --
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/doc/android.txt b/doc/android.txt
index 5f4ee95..e287be0 100644
--- a/doc/android.txt
+++ b/doc/android.txt
@@ -47,7 +47,8 @@ ROUTE network netmask
 
 To tell the UI which routes should be set on the tun interface.
 
-DNSSERVER serverip
+DNSSERVER IP server address
+DNS6SERVER IPv6 server address
 DNSDOMAIN searchdomain
 
 To set the DNS server and search domain.
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 5950906..04ebf99 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -1629,14 +1629,20 @@ void
 open_tun (const char *dev, const char *dev_type, const char *dev_node, struct 
tuntap *tt)
 {
 #define ANDROID_TUNNAME "vpnservice-tun"
-  int i;
   struct user_pass up;
   struct gc_arena gc = gc_new ();
   bool opentun;
 
   int oldtunfd = tt->fd;
 
-  for (i = 0; i < tt->options.dns_len; ++i) {
+  /* Prefer IPv6 DNS servers,
+   * Android will use the DNS server in the order we specify*/
+  for (int i = 0; i < tt->options.dns6_len; i++) {
+management_android_control (management, "DNS6SERVER",
+   print_in6_addr (tt->options.dns6[i], 0, ));
+  }
+
+  for (int i = 0; i < tt->options.dns_len; i++) {
 management_android_control (management, "DNSSERVER",
print_in_addr_t(tt->options.dns[i], 0, ));
   }
-- 
2.9.3 (Apple Git-75)


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