Patch V2: Prefer IPv6 DNS servers
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1479814716-20116-1-git-send-email-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg13195.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
... | ... |
@@ -47,7 +47,8 @@ ROUTE network netmask |
47 | 47 |
|
48 | 48 |
To tell the UI which routes should be set on the tun interface. |
49 | 49 |
|
50 |
-DNSSERVER serverip |
|
50 |
+DNSSERVER IP server address |
|
51 |
+DNS6SERVER IPv6 server address |
|
51 | 52 |
DNSDOMAIN searchdomain |
52 | 53 |
|
53 | 54 |
To set the DNS server and search domain. |
... | ... |
@@ -1638,14 +1638,20 @@ void |
1638 | 1638 |
open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt) |
1639 | 1639 |
{ |
1640 | 1640 |
#define ANDROID_TUNNAME "vpnservice-tun" |
1641 |
- int i; |
|
1642 | 1641 |
struct user_pass up; |
1643 | 1642 |
struct gc_arena gc = gc_new (); |
1644 | 1643 |
bool opentun; |
1645 | 1644 |
|
1646 | 1645 |
int oldtunfd = tt->fd; |
1647 | 1646 |
|
1648 |
- for (i = 0; i < tt->options.dns_len; ++i) { |
|
1647 |
+ /* Prefer IPv6 DNS servers, |
|
1648 |
+ * Android will use the DNS server in the order we specify*/ |
|
1649 |
+ for (int i = 0; i < tt->options.dns6_len; i++) { |
|
1650 |
+ management_android_control (management, "DNS6SERVER", |
|
1651 |
+ print_in6_addr (tt->options.dns6[i], 0, &gc)); |
|
1652 |
+ } |
|
1653 |
+ |
|
1654 |
+ for (int i = 0; i < tt->options.dns_len; i++) { |
|
1649 | 1655 |
management_android_control (management, "DNSSERVER", |
1650 | 1656 |
print_in_addr_t(tt->options.dns[i], 0, &gc)); |
1651 | 1657 |
} |