From: "cron2 (Code Review)" Date: Wed, 18 Jun 2025 13:01:12 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., heiko@...515..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <4de68b41e43fb1ac51200b07fd4a0b8f041ed39a-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="4jTEiyp3ric="; charset=UTF-8 Subject: [Openvpn-devel] [L] Change in openvpn[master]: dns: deal with --dhcp-options when --dns is active List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: d12fk Cc: stipa , flichtenheld , plaisthos , openvpn-devel --4jTEiyp3ric= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/90= 4?usp=3Demail ) Change subject: dns: deal with --dhcp-options when --dns is active ...................................................................... dns: deal with --dhcp-options when --dns is active Since --dns settings overrule DNS related --dhcp-options, remove the latter when values were defined via --dns. To stay as backward compatible as possible, we add foreign_options to the script hook environment from the --dns values when a --up script is defined. In that case the default --dns-updown is not run, even when --dns values are present, to prevent double DNS configuration. This way an existing --up script that deals with DNS can run, without the immediate need to change after an openvpn upgrade and a server pushing --dns options. If you specify a custom --dns-updown, or force running the default dns-updown that comes with openvpn, those compat env vars are not set for --up scripts and the dns-updown command is run, even when there's an --up script present. Since Android uses the DNS values from tuntap_options, we always override those with --dns stuff unconditionally. Also on Windows when --ip-win32 is dynamic or adaptive, since DHCP relies on these as well. Change-Id: I635c4018fb43b5976a39b6a90cb2e9cb2570cd6a Signed-off-by: Heiko Hund Acked-by: Gert Doering Message-Id: <20250618124835.24737-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31= 922.html Signed-off-by: Gert Doering --- M src/openvpn/dns.c M src/openvpn/dns.h M src/openvpn/options.c 3 files changed, 323 insertions(+), 184 deletions(-) diff --git a/src/openvpn/dns.c b/src/openvpn/dns.c index 7cf1b63..939ae09 100644 --- a/src/openvpn/dns.c +++ b/src/openvpn/dns.c @@ -691,7 +691,8 @@ static void run_up_down_command(bool up, struct options *o, const struct tuntap *tt, s= truct dns_updown_runner_info *updown_runner) { - if (!o->dns_options.updown) + struct dns_options *dns =3D &o->dns_options; + if (!dns->updown || (o->up_script && !dns->user_set_updown)) { return; } @@ -701,7 +702,7 @@ if (!updown_runner->required) { /* Run dns updown directly */ - status =3D do_run_up_down_command(up, NULL, &o->dns_options, tt); + status =3D do_run_up_down_command(up, NULL, dns, tt); } else { @@ -852,6 +853,14 @@ { return; } +#ifdef _WIN32 + /* Don't use iservice in DHCP mode */ + struct tuntap_options *tto =3D &o->tuntap_options; + if (tto->ip_win32_type =3D=3D IPW32_SET_DHCP_MASQ || tto->ip_win32_typ= e =3D=3D IPW32_SET_ADAPTIVE) + { + return; + } +#endif /* Warn about adding servers of unsupported AF */ const struct dns_server *s =3D o->dns_options.servers; diff --git a/src/openvpn/dns.h b/src/openvpn/dns.h index 60f5471..688daa7 100644 --- a/src/openvpn/dns.h +++ b/src/openvpn/dns.h @@ -76,7 +76,28 @@ #endif }; +#ifndef N_DHCP_ADDR +#define N_DHCP_ADDR 4 +#endif + +#ifndef N_SEARCH_LIST_LEN +#define N_SEARCH_LIST_LEN 10 +#endif + +struct dhcp_options { + in_addr_t dns[N_DHCP_ADDR]; + int dns_len; + + struct in6_addr dns6[N_DHCP_ADDR]; + int dns6_len; + + const char *domain; + const char *domain_search_list[N_SEARCH_LIST_LEN]; + int domain_search_list_len; +}; + struct dns_options { + struct dhcp_options from_dhcp; struct dns_domain *search_domains; struct dns_server *servers_prepull; struct dns_server *servers; diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 6ea01d4..d758a67 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -1328,7 +1328,6 @@ #endif /* ifndef ENABLE_SMALL */ #endif /* ifdef _WIN32 */ -#if defined(_WIN32) || defined(TARGET_ANDROID) static void dhcp_option_dns6_parse(const char *parm, struct in6_addr *dns6_list, int *= len, int msglevel) { @@ -1371,150 +1370,6 @@ } } -/* - * If DNS options are set use these for TUN/TAP options as well. - * Applies to DNS, DNS6 and DOMAIN-SEARCH. - * Existing options will be discarded. - */ -static void -tuntap_options_copy_dns(struct options *o) -{ - struct tuntap_options *tt =3D &o->tuntap_options; - struct dns_options *dns =3D &o->dns_options; - - if (dns->search_domains) - { - tt->domain_search_list_len =3D 0; - const struct dns_domain *domain =3D dns->search_domains; - while (domain && tt->domain_search_list_len < N_SEARCH_LIST_LEN) - { - tt->domain_search_list[tt->domain_search_list_len++] =3D domai= n->name; - domain =3D domain->next; - } - if (domain) - { - msg(M_WARN, "WARNING: couldn't copy all --dns search-domains t= o --dhcp-option"); - } - tt->dhcp_options |=3D DHCP_OPTIONS_DHCP_REQUIRED; - } - - if (dns->servers) - { - tt->dns_len =3D 0; - tt->dns6_len =3D 0; - bool overflow =3D false; - const struct dns_server *server =3D dns->servers; - while (server) - { - for (int i =3D 0; i < server->addr_count; ++i) - { - if (server->addr[i].family =3D=3D AF_INET) - { - if (tt->dns_len >=3D N_DHCP_ADDR) - { - overflow =3D true; - continue; - } - tt->dns[tt->dns_len++] =3D ntohl(server->addr[i].in.a4= .s_addr); - } - else - { - if (tt->dns6_len >=3D N_DHCP_ADDR) - { - overflow =3D true; - continue; - } - tt->dns6[tt->dns6_len++] =3D server->addr[i].in.a6; - } - } - server =3D server->next; - } - if (overflow) - { - msg(M_WARN, "WARNING: couldn't copy all --dns server addresses= to --dhcp-option"); - } - tt->dhcp_options |=3D DHCP_OPTIONS_DHCP_OPTIONAL; - } -} -#else /* if defined(_WIN32) || defined(TARGET_ANDROID) */ -static void -foreign_options_copy_dns(struct options *o, struct env_set *es) -{ - const struct dns_domain *domain =3D o->dns_options.search_domains; - const struct dns_server *server =3D o->dns_options.servers; - if (!domain && !server) - { - return; - } - - /* reset the index since we're starting all over again */ - int opt_max =3D o->foreign_option_index; - o->foreign_option_index =3D 0; - - for (int i =3D 1; i <=3D opt_max; ++i) - { - char name[32]; - snprintf(name, sizeof(name), "foreign_option_%d", i); - - const char *env_str =3D env_set_get(es, name); - const char *value =3D strchr(env_str, '=3D') + 1; - if ((domain && strstr(value, "dhcp-option DOMAIN-SEARCH") =3D=3D v= alue) - || (server && strstr(value, "dhcp-option DNS") =3D=3D value)) - { - setenv_del(es, name); - } - else - { - setenv_foreign_option(o, &value, 1, es); - } - } - - struct gc_arena gc =3D gc_new(); - - while (server) - { - for (size_t i =3D 0; i < server->addr_count; ++i) - { - if (server->addr[i].family =3D=3D AF_INET) - { - const char *argv[] =3D { - "dhcp-option", - "DNS", - print_in_addr_t(server->addr[i].in.a4.s_addr, 0, &gc) - }; - setenv_foreign_option(o, argv, 3, es); - } - else - { - const char *argv[] =3D { - "dhcp-option", - "DNS6", - print_in6_addr(server->addr[i].in.a6, 0, &gc) - }; - setenv_foreign_option(o, argv, 3, es); - } - } - server =3D server->next; - } - while (domain) - { - const char *argv[] =3D { "dhcp-option", "DOMAIN-SEARCH", domain->n= ame }; - setenv_foreign_option(o, argv, 3, es); - domain =3D domain->next; - } - - gc_free(&gc); - - /* remove old leftover entries */ - while (o->foreign_option_index < opt_max) - { - char name[32]; - snprintf(name, sizeof(name), "foreign_option_%d", opt_max--); - setenv_del(es, name); - } -} -#endif /* if defined(_WIN32) || defined(TARGET_ANDROID) */ - #ifndef ENABLE_SMALL static const char * print_vlan_accept(enum vlan_acceptable_frames mode) @@ -3603,6 +3458,260 @@ } } +#if defined(_WIN32) || defined(TARGET_ANDROID) +/** + * @brief Postprocess DNS related settings + * + * Set TUN/TAP DNS options with values from either --dns + * or --dhcp-option. + * + * @param o pointer to the options struct + */ +static void +tuntap_options_postprocess_dns(struct options *o) +{ + struct dns_options *dns =3D &o->dns_options; + struct tuntap_options *tt =3D &o->tuntap_options; + if (!dns->servers) + { + /* Copy --dhcp-options to tuntap_options */ + struct dhcp_options *dhcp =3D &dns->from_dhcp; + assert(sizeof(dhcp->dns) =3D=3D sizeof(tt->dns)); + assert(sizeof(dhcp->dns6) =3D=3D sizeof(tt->dns6)); + assert(sizeof(dhcp->domain_search_list) =3D=3D sizeof(tt->domain_s= earch_list)); + + tt->domain =3D dhcp->domain; + tt->dns_len =3D dhcp->dns_len; + tt->dns6_len =3D dhcp->dns6_len; + + memcpy(tt->dns, dhcp->dns, sizeof(tt->dns)); + memcpy(tt->dns6, dhcp->dns6, sizeof(tt->dns6)); + + tt->domain_search_list_len =3D dhcp->domain_search_list_len; + for (size_t i =3D 0; i < SIZE(tt->domain_search_list); ++i) + { + tt->domain_search_list[i] =3D dhcp->domain_search_list[i]; + } + + return; + } + +#if defined(_WIN32) + if (tt->ip_win32_type !=3D IPW32_SET_DHCP_MASQ && tt->ip_win32_type != =3D IPW32_SET_ADAPTIVE) + { + return; /* Not in DHCP mode */ + } +#endif /* if defined(_WIN32) */ + + /* Copy --dns options to tuntap_options */ + const struct dns_domain *d =3D dns->search_domains; + while (d && tt->domain_search_list_len + 1 < N_SEARCH_LIST_LEN) + { + tt->domain_search_list[tt->domain_search_list_len++] =3D d->name; + d =3D d->next; + } + if (d) + { + msg(M_WARN, "WARNING: couldn't copy all --dns search-domains to TU= N/TAP"); + } + + const struct dns_server *s =3D dns->servers; + while (s) + { + bool non_standard_server_port =3D false; + for (int i =3D 0; i < s->addr_count; ++i) + { + if (s->addr[i].port && s->addr[i].port !=3D 53) + { + non_standard_server_port =3D true; + break; + } + } + if ((s->transport && s->transport !=3D DNS_TRANSPORT_PLAIN) + || (s->dnssec && s->dnssec !=3D DNS_SECURITY_NO) + || non_standard_server_port) + { + /* Skip servers requiring unsupported config to be set */ + s =3D s->next; + } + else + { + bool overflow =3D false; + for (int i =3D 0; i < s->addr_count; ++i) + { + if (s->addr[i].family =3D=3D AF_INET && tt->dns_len + 1 < = N_DHCP_ADDR) + { + tt->dns[tt->dns_len++] =3D s->addr[i].in.a4.s_addr; + } + else if (tt->dns6_len + 1 < N_DHCP_ADDR) + { + tt->dns6[tt->dns6_len++] =3D s->addr[i].in.a6; + } + else + { + overflow =3D true; + } + } + if (overflow) + { + msg(M_WARN, "WARNING: couldn't copy all --dns server addre= sses to TUN/TAP"); + } + return; + } + } +} + +#else /* if defined(_WIN32) || defined(TARGET_ANDROID) */ + +/** + * @brief Postprocess DNS related settings + * + * Discard existing --dhcp-options from the env if needed and possibly + * replace them with values from --dns. If no --dns servers are set copy + * the --dhcp-option values over for --dns-updown runs. + * + * @param o pointer to the options struct + * @param es env set to modify potentially + */ +static void +dhcp_options_postprocess_dns(struct options *o, struct env_set *es) +{ + struct gc_arena gc =3D gc_new(); + struct dns_options *dns =3D &o->dns_options; + + if (dns->servers || dns->user_set_updown) + { + /* Clean up env from --dhcp-option DNS config */ + struct buffer name =3D alloc_buf_gc(OPTION_PARM_SIZE, &gc); + struct buffer value =3D alloc_buf_gc(OPTION_PARM_SIZE, &gc); + + const int fo_count =3D o->foreign_option_index; + o->foreign_option_index =3D 0; + + for (int i =3D 1; i <=3D fo_count; ++i) + { + buf_clear(&name); + buf_printf(&name, "foreign_option_%d", i); + const char *env_str =3D env_set_get(es, BSTR(&name)); + const char *item_val =3D strchr(env_str, '=3D') + 1; + buf_clear(&value); + buf_printf(&value, "%s", item_val); + + /* Remove foreign option item from env set */ + env_set_del(es, BSTR(&name)); + + item_val =3D BSTR(&value); + if (strncmp(item_val, "dhcp-option ", 12) !=3D 0 + || (strncmp(item_val + 12, "ADAPTER-DOMAIN-SUFFIX ", 22) != =3D 0 + && strncmp(item_val + 12, "DOMAIN-SEARCH ", 14) !=3D 0 + && strncmp(item_val + 12, "DOMAIN ", 7) !=3D 0 + && strncmp(item_val + 12, "DNS6 ", 5) !=3D 0 + && strncmp(item_val + 12, "DNS ", 4) !=3D 0)) + { + /* Re-set the item with potentially updated name */ + buf_clear(&name); + buf_printf(&name, "foreign_option_%d", ++o->foreign_option= _index); + setenv_str(es, BSTR(&name), BSTR(&value)); + } + } + } + + if (!dns->servers) + { + /* Copy --dhcp-options to dns_options */ + struct dhcp_options *dhcp =3D &dns->from_dhcp; + + if (dhcp->dns_len || dhcp->dns6_len) + { + struct dns_domain **entry =3D &dns->search_domains; + ALLOC_OBJ_CLEAR_GC(*entry, struct dns_domain, &dns->gc); + struct dns_domain *new =3D *entry; + new->name =3D dhcp->domain; + entry =3D &new->next; + + for (size_t i =3D 0; i < dhcp->domain_search_list_len; ++i) + { + ALLOC_OBJ_CLEAR_GC(*entry, struct dns_domain, &dns->gc); + struct dns_domain *new =3D *entry; + new->name =3D dhcp->domain_search_list[i]; + entry =3D &new->next; + } + + struct dns_server *server =3D dns_server_get(&dns->servers, 0,= &dns->gc); + const size_t max_addrs =3D SIZE(server->addr); + for (size_t i =3D 0; i < dhcp->dns_len && server->addr_count <= max_addrs; ++i) + { + server->addr[server->addr_count].in.a4.s_addr =3D htonl(dh= cp->dns[i]); + server->addr[server->addr_count].family =3D AF_INET; + server->addr_count +=3D 1; + } + for (size_t i =3D 0; i < dhcp->dns6_len && server->addr_count = < max_addrs; ++i) + { + server->addr[server->addr_count].in.a6 =3D dhcp->dns6[i]; + server->addr[server->addr_count].family =3D AF_INET6; + server->addr_count +=3D 1; + } + } + } + else if (o->up_script && !dns->user_set_updown) + { + /* Set foreign option env vars from --dns config */ + const char *p[] =3D { "dhcp-option", NULL, NULL }; + size_t p_len =3D sizeof(p) / sizeof(p[0]); + + p[1] =3D "DOMAIN"; + const struct dns_domain *d =3D dns->search_domains; + while (d) + { + p[2] =3D d->name; + setenv_foreign_option(o, (const char **)p, p_len, es); + d =3D d->next; + } + + const struct dns_server *s =3D dns->servers; + while (s) + { + bool non_standard_server_port =3D false; + for (int i =3D 0; i < s->addr_count; ++i) + { + if (s->addr[i].port && s->addr[i].port !=3D 53) + { + non_standard_server_port =3D true; + break; + } + } + if ((s->transport && s->transport !=3D DNS_TRANSPORT_PLAIN) + || (s->dnssec && s->dnssec !=3D DNS_SECURITY_NO) + || non_standard_server_port) + { + /* Skip servers requiring unsupported config to be set */ + s =3D s->next; + } + else + { + for (int i =3D 0; i < s->addr_count; ++i) + { + if (s->addr[i].family =3D=3D AF_INET) + { + p[1] =3D "DNS"; + p[2] =3D print_in_addr_t(s->addr[i].in.a4.s_addr, = IA_NET_ORDER, &gc); + } + else + { + p[1] =3D "DNS6"; + p[2] =3D print_in6_addr(s->addr[i].in.a6, 0, &gc); + } + setenv_foreign_option(o, (const char **)p, p_len, es); + } + break; + } + } + } + + gc_free(&gc); +} +#endif /* if defined(_WIN32) || defined(TARGET_ANDROID) */ + static void options_postprocess_mutate(struct options *o, struct env_set *es) { @@ -3786,9 +3895,9 @@ else { #if defined(_WIN32) || defined(TARGET_ANDROID) - tuntap_options_copy_dns(o); + tuntap_options_postprocess_dns(o); #else - foreign_options_copy_dns(o, es); + dhcp_options_postprocess_dns(o, es); #endif } if (o->auth_token_generate && !o->auth_token_renewal) @@ -4171,9 +4280,9 @@ { dns_options_postprocess_pull(&o->dns_options); #if defined(_WIN32) || defined(TARGET_ANDROID) - tuntap_options_copy_dns(o); + tuntap_options_postprocess_dns(o); #else - foreign_options_copy_dns(o, es); + dhcp_options_postprocess_dns(o, es); #endif } return success; @@ -8162,18 +8271,43 @@ goto err; } } -#if defined(_WIN32) || defined(TARGET_ANDROID) else if (streq(p[0], "dhcp-option") && p[1]) { + struct dhcp_options *dhcp =3D &options->dns_options.from_dhcp; +#if defined(_WIN32) || defined(TARGET_ANDROID) struct tuntap_options *o =3D &options->tuntap_options; +#endif VERIFY_PERMISSION(OPT_P_DHCPDNS); - if ((streq(p[1], "DOMAIN") || streq(p[1], "ADAPTER_DOMAIN_SUFFIX")) - && p[2] && !p[3]) + if ((streq(p[1], "DOMAIN") || streq(p[1], "ADAPTER_DOMAIN_SUFFIX")= ) && p[2] && !p[3]) { - o->domain =3D p[2]; - o->dhcp_options |=3D DHCP_OPTIONS_DHCP_OPTIONAL; + dhcp->domain =3D p[2]; } + else if (streq(p[1], "DOMAIN-SEARCH") && p[2] && !p[3]) + { + if (dhcp->domain_search_list_len < N_SEARCH_LIST_LEN) + { + dhcp->domain_search_list[dhcp->domain_search_list_len++] = =3D p[2]; + } + else + { + msg(msglevel, "--dhcp-option %s: maximum of %d search entr= ies can be specified", + p[1], N_SEARCH_LIST_LEN); + } + } + else if ((streq(p[1], "DNS") || streq(p[1], "DNS6")) && p[2] && !p= [3] + && (!strstr(p[2], ":") || ipv6_addr_safe(p[2]))) + { + if (strstr(p[2], ":")) + { + dhcp_option_dns6_parse(p[2], dhcp->dns6, &dhcp->dns6_len, = msglevel); + } + else + { + dhcp_option_address_parse("DNS", p[2], dhcp->dns, &dhcp->d= ns_len, msglevel); + } + } +#if defined(_WIN32) || defined(TARGET_ANDROID) else if (streq(p[1], "NBS") && p[2] && !p[3]) { o->netbios_scope =3D p[2]; @@ -8191,23 +8325,9 @@ o->netbios_node_type =3D t; o->dhcp_options |=3D DHCP_OPTIONS_DHCP_REQUIRED; } - else if ((streq(p[1], "DNS") || streq(p[1], "DNS6")) && p[2] && !p= [3] - && (!strstr(p[2], ":") || ipv6_addr_safe(p[2]))) - { - if (strstr(p[2], ":")) - { - dhcp_option_dns6_parse(p[2], o->dns6, &o->dns6_len, msglev= el); - } - else - { - dhcp_option_address_parse("DNS", p[2], o->dns, &o->dns_len= , msglevel); - o->dhcp_options |=3D DHCP_OPTIONS_DHCP_OPTIONAL; - } - } else if (streq(p[1], "WINS") && p[2] && !p[3]) { dhcp_option_address_parse("WINS", p[2], o->wins, &o->wins_len,= msglevel); - o->dhcp_options |=3D DHCP_OPTIONS_DHCP_OPTIONAL; } else if (streq(p[1], "NTP") && p[2] && !p[3]) { @@ -8219,19 +8339,6 @@ dhcp_option_address_parse("NBDD", p[2], o->nbdd, &o->nbdd_len,= msglevel); o->dhcp_options |=3D DHCP_OPTIONS_DHCP_REQUIRED; } - else if (streq(p[1], "DOMAIN-SEARCH") && p[2] && !p[3]) - { - if (o->domain_search_list_len < N_SEARCH_LIST_LEN) - { - o->domain_search_list[o->domain_search_list_len++] =3D p[2= ]; - } - else - { - msg(msglevel, "--dhcp-option %s: maximum of %d search entr= ies can be specified", - p[1], N_SEARCH_LIST_LEN); - } - o->dhcp_options |=3D DHCP_OPTIONS_DHCP_OPTIONAL; - } else if (streq(p[1], "DISABLE-NBT") && !p[2]) { o->disable_nbt =3D 1; @@ -8249,8 +8356,10 @@ msg(msglevel, "--dhcp-option: unknown option type '%s' or miss= ing or unknown parameter", p[1]); goto err; } - } +#else /* if defined(_WIN32) || defined(TARGET_ANDROID) */ + setenv_foreign_option(options, (const char **)p, 3, es); #endif /* if defined(_WIN32) || defined(TARGET_ANDROID) */ + } #ifdef _WIN32 else if (streq(p[0], "show-adapters") && !p[1]) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/904?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I635c4018fb43b5976a39b6a90cb2e9cb2570cd6a Gerrit-Change-Number: 904 Gerrit-PatchSet: 25 Gerrit-Owner: d12fk Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-Reviewer: stipa Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --4jTEiyp3ric= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

dns: deal with --dhcp-options when --dns is ac=
tive

Since --dns settings overrule DNS related --dhcp-options,
re= move the latter when values were defined via --dns.

To stay as backw= ard compatible as possible, we add foreign_options to
the script hook en= vironment from the --dns values when a --up script
is defined. In that c= ase the default --dns-updown is not run, even
when --dns values are pres= ent, to prevent double DNS configuration.
This way an existing --up scri= pt that deals with DNS can run, without
the immediate need to change aft= er an openvpn upgrade and a server
pushing --dns options.

If you = specify a custom --dns-updown, or force running the default
dns-updown t= hat comes with openvpn, those compat env vars are not set
for --up scrip= ts and the dns-updown command is run, even when there's
an --up scri= pt present.

Since Android uses the DNS values from tuntap_options, w= e always
override those with --dns stuff unconditionally. Also on Window= s when
--ip-win32 is dynamic or adaptive, since DHCP relies on these as = well.

Change-Id: I635c4018fb43b5976a39b6a90cb2e9cb2570cd6a
Signed= -off-by: Heiko Hund <heiko@...2662...>
Acked-by: Gert Doering <= gert@...1296...>
Message-Id: <20250618124835.24737-1-gert@...1725...= ..>
URL: https://www.mail-archive.com/openvpn-devel@...282...= .net/msg31922.html
Signed-off-by: Gert Doering <gert@...1296...>---
M src/openvpn/dns.c
M src/openvpn/dns.h
M src/openvpn/option= s.c
3 files changed, 323 insertions(+), 184 deletions(-)

diff --git a/src/openvpn/dns.c b/src/openvpn/dns.c
index= 7cf1b63..939ae09 100644
--- a/src/openvpn/dns.c
= +++ b/src/openvpn/dns.c
@@ -691,7 +691,8 @@ static void
run_up_down_command(bool up, struct op= tions *o, const struct tuntap *tt, struct dns_updown_runner_info *updown_ru= nner)
{
+ struct dns_options *dns =3D &o->dns_options;
+ if (!dns->updo= wn || (o->up_script && !dns->user_set_updown))
{

return;
}
= @@ -701,7 +702,7 @@
if (!updown_runner->requi= red)
{
/* Run dns updown dire= ctly */
- status= =3D do_run_up_down_command(up, NULL, &o->dns_options, tt);+ status =3D do_run_up= _down_command(up, NULL, dns, tt);
}
= else
{
@@ -852,6 +853,14 @@<= br> {
return;
}

+#ifdef _WIN32+ /* Don't use iservice= in DHCP mode */
+ = struct tuntap_options *tto =3D &o->tuntap_options;
+ if (tto->ip_win32_type =3D=3D= IPW32_SET_DHCP_MASQ || tto->ip_win32_type =3D=3D IPW32_SET_ADAPTIVE)
+ {
+ return;
+ }
+#endif

/* Warn = about adding servers of unsupported AF */
const struct= dns_server *s =3D o->dns_options.servers;
diff --git a/= src/openvpn/dns.h b/src/openvpn/dns.h
index 60f5471..688daa= 7 100644
--- a/src/openvpn/dns.h
+++ b/src/= openvpn/dns.h
@@ -76,7 +76,28 @@
#endif
};

+#ifndef N_DHCP_ADDR
+#define N_DHCP_ADDR 4
+#endif
+
+#ifndef N_SEAR= CH_LIST_LEN
+#define = N_SEARCH_LIST_LEN 10
= +#endif
+
<= span style=3D"color: hsl(120, 100%, 40%);">+struct dhcp_options {
+ in_addr_t dns[N_DHCP_ADDR= ];
+ int dns_len;<= /span>
+
+ struct in6_addr dns6[N_DHCP_ADDR];<= /span>
+ int dns6_len;
+
+ const char *domain;
+ const char *domain_search_list[N_= SEARCH_LIST_LEN];
+ = int domain_search_list_len;
+};
+=
struct dns_options {
+ struct dhcp_options from_dhcp;
struct = dns_domain *search_domains;
struct dns_server *servers= _prepull;
struct dns_server *servers;
= diff --git a/src/openvpn/options.c b/src/openvpn/options.c
= index 6ea01d4..d758a67 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -1328,7 +1328= ,6 @@
#endif /* ifndef ENABLE_SMALL */
#e= ndif /* ifdef _WIN32 */

-#if defined(_WIN32) || defined(TARGET_ANDROID) static void
dhcp_option_dns6_parse(const char *pa= rm, struct in6_addr *dns6_list, int *len, int msglevel)
{<= /span>
@@ -1371,150 +1370,6 @@
}
}


- * If DNS option= s are set use these for TUN/TAP options as well.
- * Applies to DNS, DNS6 and DOMAIN-SEARCH.
- * Existing options will be= discarded.
- */=
-static void
-tuntap_options_copy_dns(struct options= *o)
-{
- struct tuntap_options *tt =3D &am= p;o->tuntap_options;

- struct dns_options *dns =3D &o->dns_options;
-
- if (dns->search_domains)
- {
- tt->domain_search_list_len =3D 0;
- const struct dns_domain *domain =3D= dns->search_domains;
- = {
- tt->= domain_search_list[tt->domain_search_list_len++] =3D domain->name;
- domain =3D d= omain->next;
- = }
- if (domain= )
- {
= - msg(M_WARN, "WA= RNING: couldn't copy all --dns search-domains to --dhcp-option");<= /span>
- }
- tt->dhcp_options |=3D D= HCP_OPTIONS_DHCP_REQUIRED;

- }
-
= - if (dns->servers)<= br>- {
- tt->dns_len =3D 0;
- tt->dns6_len =3D 0;
- bool overflow =3D = false;
- const s= truct dns_server *server =3D dns->servers;
- while (server)
- {
- for (int i =3D 0; i < server->addr_count; ++= i)
- {
- if (server-= >addr[i].family =3D=3D AF_INET)
- {
- if (tt->dns_len >=3D N_DHCP_ADDR)=
- {=
- over= flow =3D true;
- = continue;
- }
- tt->dns[tt->dns_len++] =3D ntohl(server->= addr[i].in.a4.s_addr);
= - }
- = else
- = {
- = if (tt->dns6_len >=3D N_DHCP_ADDR)
- {
- overflow =3D true;<= /span>
- = continue;
- = }
- = tt->dns6[tt->dns6_len++] =3D server->addr[i].in.a6;
- }- }
- server =3D server->next= ;
- }
= - if (overflow)
= - {
- msg(M_WARN, "WARNING: coul= dn't copy all --dns server addresses to --dhcp-option");- }
- tt->dhcp_options |=3D DHCP_OPTIO= NS_DHCP_OPTIONAL;
- = }
-}
-#else /* if defined(_WIN32) || defined(T= ARGET_ANDROID) */
-stat= ic void
-foreign_option= s_copy_dns(struct options *o, struct env_set *es)
-{
- const struct dns_domain *domain =3D o->dns_options.search_do= mains;
- const struc= t dns_server *server =3D o->dns_options.servers;
- if (!domain && !server)<= br>- {
- return;
- }
-
- /* rese= t the index since we're starting all over again */
- int opt_max =3D o->foreign_option_i= ndex;
- o->foreig= n_option_index =3D 0;
-=
- for (int i =3D 1;= i <=3D opt_max; ++i)
- char = name[32];
- snpr= intf(name, sizeof(name), "foreign_option_%d", i);
-

- const char *env_str =3D env_set_get(es, name);

- const char *value= =3D strchr(env_str, '=3D') + 1;
- if ((domain && strstr(value, "dhcp-= option DOMAIN-SEARCH") =3D=3D value)
- || (server && strstr(value, "d= hcp-option DNS") =3D=3D value))
- {
- }
- = {
- setenv= _foreign_option(o, &value, 1, es);
- }
- }
-
= - struct gc_arena gc =3D gc_ne= w();
-
- while (server)
- {
- for (size_t i =3D 0; i < server->addr_count= ; ++i)
- {
- if (server->= addr[i].family =3D=3D AF_INET)
- {
= - const char *argv[] =3D {
- "dhcp-option",
= - "DNS&qu= ot;,
- = print_in_addr_t(server->addr[i].in.a4.s_addr, 0, &gc)
<= span style=3D"color: hsl(0, 100%, 40%);">- };

- setenv_foreign_optio= n(o, argv, 3, es);

- = }
- = else
- {
- const ch= ar *argv[] =3D {
- = "dhcp-option",
- "DNS6",
- print_in6_addr(server= ->addr[i].in.a6, 0, &gc)
- };
- setenv_foreign_option(o, argv, 3, es);
- }

- }
- server =3D server->next;
- }
- while (domain)
- {
- = const char *argv[] =3D { "dhcp-option", "DOMAIN-SEARC= H", domain->name };
- setenv_foreign_option(o, argv, 3, es);
- domain =3D domain->next;<= br>- }
-
- gc_free(&gc);
-
- /* rem= ove old leftover entries */
- while (o->foreign_option_index < opt_max)
- {
- char name[32];
- snprintf(name, sizeof(name), "foreign_opt= ion_%d", opt_max--);
- setenv_del(es, name);
- }
-}
-#endif /* if defined(_WI= N32) || defined(TARGET_ANDROID) */
-
#ifndef ENABLE_SMALL
static= const char *
print_vlan_accept(enum vlan_acceptable_frame= s mode)
@@ -3603,6 +3458,260 @@
}
}

+#if defined(_WIN32) || defined(TARGET_ANDROID)
+/**

+ * @brief Postprocess DNS related settings+ *
+ * Set TUN/TAP DNS options with values from e= ither --dns
+ * or --= dhcp-option.
+ *
+ * @param o pointer = to the options struct
+ */
+static void
+tuntap_options_postpro= cess_dns(struct options *o)
+{
+ struct= dns_options *dns =3D &o->dns_options;
+ struct tuntap_options *tt =3D &o->tunt= ap_options;
+ if (= !dns->servers)
+ = {
+ /* Copy = --dhcp-options to tuntap_options */
+ struct dhcp_options *dhcp =3D &dns->from_dhc= p;
+ assert(si= zeof(dhcp->dns) =3D=3D sizeof(tt->dns));
+ assert(sizeof(dhcp->dns6) =3D=3D size= of(tt->dns6));
+ = assert(sizeof(dhcp->domain_search_list) =3D=3D sizeof(tt->domai= n_search_list));
+
+ tt->domain = =3D dhcp->domain;
= + tt->dns_len =3D dhcp->dns_len;
+ tt->dns6_len =3D dhcp->dns6_len;
+
+ memcpy(tt->dns, dhcp->dns, = sizeof(tt->dns));
= + memcpy(tt->dns6, dhcp->dns6, sizeof(tt->dns6));+
+ tt->domain_search_list_len =3D dhcp-&= gt;domain_search_list_len;
+ for (size_t i =3D 0; i < SIZE(tt->domain_search_list);= ++i)
+ {
+ tt->domai= n_search_list[i] =3D dhcp->domain_search_list[i];
+ }
+
+ return;
= + }
+
+#if defined(_WIN32)

+ if (tt->ip_win32_type != =3D IPW32_SET_DHCP_MASQ && tt->ip_win32_type !=3D IPW32_SET_ADAP= TIVE)

+ {+ return; /* Not i= n DHCP mode */
+ }=
+#endif /* if define= d(_WIN32) */
+=
+ /* Copy --dns options = to tuntap_options */
= + const struct dns_domain *d =3D dns->search_domains;
+ while (d && tt->doma= in_search_list_len + 1 < N_SEARCH_LIST_LEN)

+ {
+ tt->domain_search_list[tt->domain_search_list_le= n++] =3D d->name;
= + d =3D d->next;
+ }
+ if = (d)
+ {
= + msg(M_WARN, "WARN= ING: couldn't copy all --dns search-domains to TUN/TAP");+ }
+
+ const struct dns_server *s =3D dns->servers;+ while (s)
+ {

+ bool non_standard_server_port =3D false;=
+ for (int i = =3D 0; i < s->addr_count; ++i)
+ {
+ if (s->addr[i].port && s->addr[i].port != =3D 53)
+ = {
+ no= n_standard_server_port =3D true;
+ break;
+ }
+ }
+= if ((s->transport && s->transport !=3D DNS_TRANSPORT_= PLAIN)
+ |= | (s->dnssec && s->dnssec !=3D DNS_SECURITY_NO)
+ || non_standard_serve= r_port)

+ {
+ /* Skip se= rvers requiring unsupported config to be set */
+ s =3D s->next;
+ }
+ else
+ {
+ bool overflow =3D false;
+ for (int i =3D 0; i < s->addr= _count; ++i)
+ = {
+ = if (s->addr[i].family =3D=3D AF_INET && tt->dns_len + 1 &l= t; N_DHCP_ADDR)
+ = {
+ = tt->dns[tt->dns_len++] =3D s->addr[i].in.a4.s_addr;<= /span>
+ }
+ else i= f (tt->dns6_len + 1 < N_DHCP_ADDR)
+ {
+ tt->dns6[tt->dns6_len++] =3D s= ->addr[i].in.a6;
+= }
+ = else
+ = {
+ = overflow =3D true;
+ }
+ }
+ if (overflow)
+ {
+ msg(M_WARN, "WARNING: couldn't copy all --= dns server addresses to TUN/TAP");
+ }
+ return;
+ }
+ }
+}+
+#else /* if defined(_WIN32) || defined(TARGET_A= NDROID) */
++/**
+ * @brief Postprocess DNS related settings
+ *
+ * Discard existing --dhcp-options fro= m the env if needed and possibly
+ * replace them with values from --dns. If no --dns servers ar= e set copy
+ * the --= dhcp-option values over for --dns-updown runs.
+ *
+ * @param o pointer to the options struct
+ * @param es env set to modify poten= tially
+ */+static void
+dhcp_options_postprocess_dns(struct o= ptions *o, struct env_set *es)
+{
+ str= uct gc_arena gc =3D gc_new();
+ struct dns_options *dns =3D &o->dns_options;+
+ if (dns->servers || dns->user_set_updo= wn)
+ {
= + /* Clean up env from -= -dhcp-option DNS config */
+ struct buffer name =3D alloc_buf_gc(OPTION_PARM_SIZE, &g= c);
+ struct b= uffer value =3D alloc_buf_gc(OPTION_PARM_SIZE, &gc);
+
+ const int fo_count =3D o->foreign_option_index= ;
+ o->fore= ign_option_index =3D 0;
+
+ for (in= t i =3D 1; i <=3D fo_count; ++i)
+ {
+ buf_clear(&name);
+ buf_printf(&name, "foreign_option_= %d", i);
+ = const char *env_str =3D env_set_get(es, BSTR(&name));
<= span style=3D"color: hsl(120, 100%, 40%);">+ const char *item_va= l =3D strchr(env_str, '=3D') + 1;

+ buf_clear(&value);
+ buf_printf(&value, &qu= ot;%s", item_val);
+
+ /* = Remove foreign option item from env set */
+ env_set_del(es, BSTR(&name));=
+
+ item_val =3D BSTR(&value);
+ if (strncm= p(item_val, "dhcp-option ", 12) !=3D 0
+ || (strncmp(item_val + 12, &qu= ot;ADAPTER-DOMAIN-SUFFIX ", 22) !=3D 0
+ && strncmp(item_val + 1= 2, "DOMAIN-SEARCH ", 14) !=3D 0
+ && strncmp(item_val + 12,= "DOMAIN ", 7) !=3D 0
+ && strncmp(item_val + 12, "DNS= 6 ", 5) !=3D 0
+= && strncmp(item_val + 12, "DNS ", 4) = !=3D 0))
+ = {
+ /= * Re-set the item with potentially updated name */
+ buf_clear(&name);=
+ buf_printf= (&name, "foreign_option_%d", ++o->foreign_option_index);
+ seten= v_str(es, BSTR(&name), BSTR(&value));
+ }
+ }
+ }
+
+ if (!dns->server= s)
+ {
<= span style=3D"color: hsl(120, 100%, 40%);">+ /* Copy --dhcp-options = to dns_options */

+ = struct dhcp_options *dhcp =3D &dns->from_dhcp;
+

+ if (dhcp->dns_len || dhcp->dns6_len)
+ {
+ struct dns_domain **e= ntry =3D &dns->search_domains;

+ ALLOC_OBJ_CLEAR_GC(*entry, struct dns_domain,= &dns->gc);
+ = struct dns_domain *new =3D *entry;
+ new->name =3D dhcp->domain;
+ entry =3D &= amp;new->next;
+
+ for (size= _t i =3D 0; i < dhcp->domain_search_list_len; ++i)
+ {
+ ALLOC_OBJ_CLEAR_GC(*entry, s= truct dns_domain, &dns->gc);
+ struct dns_domain *new =3D *entry;+ new->name= =3D dhcp->domain_search_list[i];
+ entry =3D &new->next;
+ }

+
+ struct dns_server *server =3D dns_server_get(&= amp;dns->servers, 0, &dns->gc);
+ const size_t max_addrs =3D SIZE(server-&g= t;addr);
+ = for (size_t i =3D 0; i < dhcp->dns_len && server->addr_co= unt < max_addrs; ++i)
+ {
+ = server->addr[server->addr_count].in.a4.s_addr =3D hton= l(dhcp->dns[i]);
+= server->addr[server->addr_count].family =3D AF_INET;<= /span>
+ serv= er->addr_count +=3D 1;
+ }
+= for (size_t i =3D 0; i < dhcp->dns6_len && server= ->addr_count < max_addrs; ++i)
+ {
+ server->addr[server->addr_count].in.a6 =3D= dhcp->dns6[i];
+ = server->addr[server->addr_count].family =3D AF_INET6;<= /span>
+ serv= er->addr_count +=3D 1;
+ }
+= }
+ }
+ else if (o->up_sc= ript && !dns->user_set_updown)
+ {
+ /* Set foreign option env vars from --dns config */<= br>+ const char *p[] =3D= { "dhcp-option", NULL, NULL };
+ size_t p_len =3D sizeof(p) / sizeof(p[0]);
+
+ p[1] =3D "DOMAIN";
+ const struct dns= _domain *d =3D dns->search_domains;
+ while (d)
+ {
+ p[2] =3D d->name;
+ setenv_foreign_option(o, (const char **)p, = p_len, es);
+ = d =3D d->next;
+ }
+<= br>+ const struct dns_se= rver *s =3D dns->servers;
+ while (s)
+ {
+ = bool non_standard_server_port =3D false;
+ for (int i =3D 0; i < s->ad= dr_count; ++i)
+ = {
+ = if (s->addr[i].port && s->addr[i].port !=3D 53)+ {
= + non_standa= rd_server_port =3D true;
+ break;
+ }
+ }
+ if ((s->transport && s->transport !=3D DNS_TR= ANSPORT_PLAIN)
+ = || (s->dnssec && s->dnssec !=3D DNS_SECURITY_NO)
+ || no= n_standard_server_port)
+ {
+ = /* Skip servers requiring unsupported config to be set */
+ s =3D s= ->next;
+ = }
+ els= e
+ {
+ for (int= i =3D 0; i < s->addr_count; ++i)
+ {
+ if (s->addr[i].family =3D=3D AF_IN= ET)
+ = {
+ = p[1] =3D "DNS";
+ p[2] =3D print_in_addr_t(s->addr= [i].in.a4.s_addr, IA_NET_ORDER, &gc);
+ }
+ else
+ {
+ p[1] =3D "DNS6&= quot;;
+ = p[2] =3D print_in6_addr(s->addr[i].in.a6, 0, &gc);=
+ }
+ sete= nv_foreign_option(o, (const char **)p, p_len, es);
+ }
+ break;
+ }
+ }
+ }
+
+ gc_free(&am= p;gc);
+}
<= span style=3D"color: hsl(120, 100%, 40%);">+#endif /* if defined(_WIN32) ||= defined(TARGET_ANDROID) */

+
static void
options_postprocess_= mutate(struct options *o, struct env_set *es)
{
= @@ -3786,9 +3895,9 @@
else
= {
#if defined(_WIN32) || defined(TARGET_ANDROID)- tuntap_options_copy_dns= (o);
+ tuntap_= options_postprocess_dns(o);
#else
- foreign_options_copy_dns(o, es);
+ dhcp_options_post= process_dns(o, es);
#endif
} if (o->auth_token_generate && !o->auth_token_ren= ewal)
@@ -4171,9 +4280,9 @@
{ dns_options_postprocess_pull(&o->dns_options);
#if defined(_WIN32) || defined(TARGET_ANDROID)
- tuntap_options_copy_dns(o);
+ tuntap_option= s_postprocess_dns(o);
#else
- foreign_options_copy_dns(o, es);
<= span style=3D"color: hsl(120, 100%, 40%);">+ dhcp_options_postproces= s_dns(o, es);

#endif
}
return success;

@@ -8162,18 +8271,43 @@
goto err;

}
= }
-#if defined(_WIN32) = || defined(TARGET_ANDROID)
else if (streq(p[0], "= dhcp-option") && p[1])
{
+ struct dhcp_options *dhcp = =3D &options->dns_options.from_dhcp;
+#if defined(_WIN32) || defined(TARGET_ANDROID)
struct tuntap_options *o =3D &options->tuntap_o= ptions;
+#endif
VERIFY_PERMISSION(OPT_P_DHCPDNS);

- if ((streq(p[1], = "DOMAIN") || streq(p[1], "ADAPTER_DOMAIN_SUFFIX"))
- && p[2= ] && !p[3])
+= if ((streq(p[1], "DOMAIN") || streq(p[1], "ADAPTER_D= OMAIN_SUFFIX")) && p[2] && !p[3])
= {
- o-&= gt;domain =3D p[2];
- = o->dhcp_options |=3D DHCP_OPTIONS_DHCP_OPTIONAL;
+ dhcp->domain =3D p= [2];

}
+ else if (streq(p[1], "DOMAIN-SEARCH") &&a= mp; p[2] && !p[3])
+ {
+ = if (dhcp->domain_search_list_len < N_SEARCH_LIST_LEN)=
+ {
+ dhcp->domain_= search_list[dhcp->domain_search_list_len++] =3D p[2];

+ }
+ else
+ {
+ msg(msglevel, "--dhcp-option %s:= maximum of %d search entries can be specified",
+ p[1], N_SEARCH_LIST_L= EN);
+ }
+ }
<= span style=3D"color: hsl(120, 100%, 40%);">+ else if ((streq(p[1], &= quot;DNS") || streq(p[1], "DNS6")) && p[2] &&= ; !p[3]

+ = && (!strstr(p[2], ":") || ipv6_addr_safe(p[2])))
+ {
+ if (strstr(p[2], &quo= t;:"))

+ = {
+ = dhcp_option_dns6_parse(p[2], dhcp->dns6, &dhcp->dns6_len, msgle= vel);
+ }<= /span>
+ else
+ {+ dhcp_option_a= ddress_parse("DNS", p[2], dhcp->dns, &dhcp->dns_len, ms= glevel);
+ = }
+ }<= br>+#if defined(_WIN32) || defi= ned(TARGET_ANDROID)
else if (streq(p[1], "NBS= ") && p[2] && !p[3])
{=
o->netbios_scope =3D p[2];
@@ -81= 91,23 +8325,9 @@
o->netbios_node_type =3D t= ;
o->dhcp_options |=3D DHCP_OPTIONS_DHCP_RE= QUIRED;
}
- else if ((streq(p[1], "DNS") || streq(p[1], = "DNS6")) && p[2] && !p[3]
- && (!strstr(p[2], = ":") || ipv6_addr_safe(p[2])))
- {
- if (strstr(p[2], ":"))
- {
- dhcp_option_dns6_parse(p[2], o->= dns6, &o->dns6_len, msglevel);
- }
- else
- = dhcp_option_address_parse("DNS", p[2], o->dns, &= ;o->dns_len, msglevel);
- o->dhcp_options |=3D DHCP_OPTIONS_DHCP_OPTIONAL;
- }
= - }
= else if (streq(p[1], "WINS") && p[2] && !p[3])=
{
dhcp_option_addres= s_parse("WINS", p[2], o->wins, &o->wins_len, msglevel);=
- o->dhc= p_options |=3D DHCP_OPTIONS_DHCP_OPTIONAL;
}
else if (streq(p[1], "NTP") && p[2] &= amp;& !p[3])
{
@@ -8219,19 +83= 39,6 @@
dhcp_option_address_parse("NBDD&q= uot;, p[2], o->nbdd, &o->nbdd_len, msglevel);
= o->dhcp_options |=3D DHCP_OPTIONS_DHCP_REQUIRED;
}

- = else if (streq(p[1], "DOMAIN-SEARCH") && p[2] && = !p[3])
- {
- if (o->domai= n_search_list_len < N_SEARCH_LIST_LEN)
- {
- o->domain_search_list[o->domain_search_li= st_len++] =3D p[2];
- = }
- = else
- {
- msg(msg= level, "--dhcp-option %s: maximum of %d search entries can be specifie= d",
- = p[1], N_SEARCH_LIST_LEN);
- }
- }
= else if (streq(p[1], "DISABLE-NBT") && !p[2])=
{
o->disable_nbt =3D 1;<= /span>
@@ -8249,8 +8356,10 @@
msg(msg= level, "--dhcp-option: unknown option type '%s' or missing or = unknown parameter", p[1]);
goto err;
}
= - }
+#else /* if d= efined(_WIN32) || defined(TARGET_ANDROID) */
+ setenv_foreign_option(options, (const char= **)p, 3, es);
#endif /* if defined(_WIN32) || defined(TAR= GET_ANDROID) */
+ = }
#ifdef _WIN32
else if (streq(p[0], = "show-adapters") && !p[1])
{<= br>

To view, visit change 904. To unsubscribe, or for h= elp writing mail filters, visit settings.

<= /div>
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I635c4018fb43b5976a39b6a90cb= 2e9cb2570cd6a
Gerrit-Change-Number: 904
Gerrit-PatchSet: 25
Gerrit-Owner: d12fk <heiko@...515...>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-Reviewer: stipa <lstipakov@...277...= >
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--4jTEiyp3ric=--