From: "mrbff (Code Review)" Date: Fri, 21 Mar 2025 04:57:34 +0000 In-Reply-To: References: Reply-To: marco@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <00eac556dac4087c94f0010ad83c7ff2c5f379c3-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="ftdkIf01rDw="; charset=UTF-8 Subject: [Openvpn-devel] [L] Change in openvpn[master]: PUSH_UPDATE: Added update_option() function. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld , stipa Cc: openvpn-devel --ftdkIf01rDw= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, mrbff, plaisthos. Hello flichtenheld, plaisthos, stipa, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/810?usp=3Demail to look at the new patch set (#13). The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied= now. Change subject: PUSH_UPDATE: Added update_option() function. ...................................................................... PUSH_UPDATE: Added update_option() function. When the function receives an option to update, it first checks whether it = has already received an option of the same type within the same update message. If it has already received it, it simply calls add_option(), otherwise it deletes all the values =E2=80=8B=E2=80=8Balready present regarding that opt= ion. Change-Id: Ia45c99e6df7b3ad24020c10b8a9b3577984ecdc2 Signed-off-by: Marco Baffo --- M src/openvpn/options.c 1 file changed, 247 insertions(+), 10 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/10/810/13 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index b35f82b..4626747 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -5560,6 +5560,13 @@ return options->forward_compatible ? M_WARN : msglevel; } +#define RESET_OPTION_ROUTES(option_ptr, field) \ + if (option_ptr) \ + { \ + option_ptr->field =3D NULL; \ + option_ptr->flags =3D 0; \ + } + /** * @brief Resets options found in the PUSH_UPDATE message that are precede= d by the `-` flag. * This function is used in push-updates to reset specified options. @@ -5614,11 +5621,7 @@ delete_routes_v4(c->c1.route_list, c->c1.tuntap, ROUTE_OPTION_FLAGS(&c->options), es, &c->net_ctx); - if (options->routes) - { - options->routes->routes =3D NULL; - options->routes->flags =3D 0; - } + RESET_OPTION_ROUTES(options->routes, routes); } } else if (streq(p[0], "route-ipv6") && !p[1]) @@ -5629,11 +5632,7 @@ delete_routes_v6(c->c1.route_ipv6_list, c->c1.tuntap, ROUTE_OPTION_FLAGS(&c->options), es, &c->net_ctx); - if (options->routes_ipv6) - { - options->routes_ipv6->routes_ipv6 =3D NULL; - options->routes_ipv6->flags =3D 0; - } + RESET_OPTION_ROUTES(options->routes_ipv6, routes_ipv6); } } else if (streq(p[0], "route-gateway") && !p[1]) @@ -5752,6 +5751,238 @@ err: msg(msglevel, "Error occurred trying to remove %s option", p[0]); } + +/** + * @brief Processes an option to update. It first checks whether it has al= ready + * received an option of the same type within the same update messa= ge. + * If the option has already been received, it calls add_option(). + * Otherwise, it deletes all existing values related to that option= before calling add_option(). + * + * @param c The context structure. + * @param options A pointer to the options structure. + * @param p An array of strings containing the options and their parameter= s. + * @param is_inline A boolean indicating if the option is inline. + * @param file The file where the function is called. + * @param line The line number where the function is called. + * @param level The level of the option. + * @param msglevel The message level for logging. + * @param permission_mask The permission mask used by VERIFY_PERMISSION(). + * @param option_types_found A pointer to the variable where the flags cor= responding to the options found are stored. + * @param es The environment set structure. + * @param update_options_found A pointer to the variable where the flags c= orresponding to the update options found are stored, + * used to check if an option of the same type= has already been processed by update_option() within the same push-update = message. + */ +static void +update_option(struct context *c, + struct options *options, + char *p[], + bool is_inline, + const char *file, + int line, + const int level, + const int msglevel, + const unsigned int permission_mask, + unsigned int *option_types_found, + struct env_set *es, + unsigned int *update_options_found) +{ + const bool pull_mode =3D BOOL_CAST(permission_mask & OPT_P_PULL_MODE); + ASSERT(MAX_PARMS >=3D 7); + + if (streq(p[0], "route") && p[1] && !p[5]) + { + if (!(*update_options_found & OPT_P_U_ROUTE)) + { + VERIFY_PERMISSION(OPT_P_ROUTE); + rol_check_alloc(options); + if (pull_mode) + { + if (!ip_or_dns_addr_safe(p[1], options->allow_pull_fqdn) &= & !is_special_addr(p[1])) /* FQDN -- may be DNS name */ + { + msg(msglevel, "route parameter network/IP '%s' must be= a valid address", p[1]); + goto err; + } + if (p[2] && !ip_addr_dotted_quad_safe(p[2])) /* FQDN -- mu= st be IP address */ + { + msg(msglevel, "route parameter netmask '%s' must be an= IP address", p[2]); + goto err; + } + if (p[3] && !ip_or_dns_addr_safe(p[3], options->allow_pull= _fqdn) && !is_special_addr(p[3])) /* FQDN -- may be DNS name */ + { + msg(msglevel, "route parameter gateway '%s' must be a = valid address", p[3]); + goto err; + } + } + if (c->c1.route_list) + { + delete_routes_v4(c->c1.route_list, c->c1.tuntap, + ROUTE_OPTION_FLAGS(&c->options), + es, &c->net_ctx); + RESET_OPTION_ROUTES(options->routes, routes); + } + *update_options_found |=3D OPT_P_U_ROUTE; + } + } + else if (streq(p[0], "route-ipv6") && p[1] && !p[4]) + { + if (!(*update_options_found & OPT_P_U_ROUTE6)) + { + VERIFY_PERMISSION(OPT_P_ROUTE); + rol6_check_alloc(options); + if (pull_mode) + { + if (!ipv6_addr_safe_hexplusbits(p[1])) + { + msg(msglevel, "route-ipv6 parameter network/IP '%s' mu= st be a valid address", p[1]); + goto err; + } + if (p[2] && !ipv6_addr_safe(p[2])) + { + msg(msglevel, "route-ipv6 parameter gateway '%s' must = be a valid address", p[2]); + goto err; + } + /* p[3] is metric, if present */ + } + if (c->c1.route_ipv6_list) + { + delete_routes_v6(c->c1.route_ipv6_list, c->c1.tuntap, + ROUTE_OPTION_FLAGS(&c->options), + es, &c->net_ctx); + RESET_OPTION_ROUTES(options->routes_ipv6, routes_ipv6); + } + *update_options_found |=3D OPT_P_U_ROUTE6; + } + } + else if (streq(p[0], "redirect-gateway") || streq(p[0], "redirect-priv= ate")) + { + if (!(*update_options_found & OPT_P_U_REDIR_GATEWAY)) + { + VERIFY_PERMISSION(OPT_P_ROUTE); + if (options->routes) + { + options->routes->flags =3D 0; + } + if (options->routes_ipv6) + { + options->routes_ipv6->flags =3D 0; + } + *update_options_found |=3D OPT_P_U_REDIR_GATEWAY; + } + } + else if (streq(p[0], "dns") && p[1]) + { + if (!(*update_options_found & OPT_P_U_DNS)) + { + VERIFY_PERMISSION(OPT_P_DHCPDNS); + if (streq(p[1], "server") && p[2] && p[3] && p[4]) + { + long priority; + if (!dns_server_priority_parse(&priority, p[2], pull_mode)) + { + msg(msglevel, "--dns server: invalid priority value '%= s'", p[2]); + goto err; + } + + struct dns_server server; + CLEAR(server); + if (streq(p[3], "address") && p[4]) + { + for (int i =3D 4; p[i]; ++i) + { + if (!dns_server_addr_parse(&server, p[i])) + { + msg(msglevel, "--dns server %ld: malformed add= ress or maximum exceeded '%s'", priority, p[i]); + goto err; + } + } + } + else if (streq(p[3], "dnssec") && !p[5]) + { + if (!streq(p[4], "yes") && !streq(p[4], "no") && !stre= q(p[4], "optional")) + { + msg(msglevel, "--dns server %ld: malformed dnssec = value '%s'", priority, p[4]); + goto err; + } + } + else if (streq(p[3], "transport") && !p[5]) + { + if (!streq(p[4], "plain") && !streq(p[4], "DoH") && !s= treq(p[4], "DoT")) + { + msg(msglevel, "--dns server %ld: malformed transpo= rt value '%s'", priority, p[4]); + goto err; + } + } + else if (!streq(p[3], "resolve-domains") + && !(streq(p[3], "sni") && !p[5])) + { + msg(msglevel, "--dns server %ld: unknown option type '= %s' or missing or unknown parameter", priority, p[3]); + goto err; + } + } + else if (!(streq(p[1], "search-domains") && p[2])) + { + msg(msglevel, "--dns: unknown option type '%s' or missing = or unknown parameter", p[1]); + goto err; + } + + gc_free(&options->dns_options.gc); + CLEAR(options->dns_options); + *update_options_found |=3D OPT_P_U_DNS; + } + } +#if defined(_WIN32) || defined(TARGET_ANDROID) + else if (streq(p[0], "dhcp-option") && p[1] && !p[3]) + { + if (!(*update_options_found & OPT_P_U_DHCP)) + { + struct tuntap_options *o =3D &options->tuntap_options; + VERIFY_PERMISSION(OPT_P_DHCPDNS); + + o->domain =3D NULL; + o->netbios_scope =3D NULL; + o->netbios_node_type =3D 0; + o->dns6_len =3D 0; + CLEAR(o->dns6); + o->dns_len =3D 0; + CLEAR(o->dns); + o->wins_len =3D 0; + CLEAR(o->wins); + o->ntp_len =3D 0; + CLEAR(o->ntp); + o->nbdd_len =3D 0; + CLEAR(o->nbdd); + while (o->domain_search_list_len-- > 0) + { + o->domain_search_list[o->domain_search_list_len] =3D NULL; + } + o->disable_nbt =3D 0; + o->dhcp_options =3D 0; +#if defined(TARGET_ANDROID) + o->http_proxy_port =3D 0; + o->http_proxy =3D NULL; +#endif + *update_options_found |=3D OPT_P_U_DHCP; + } + } +#else /* if defined(_WIN32) || defined(TARGET_ANDROID) */ + else if (streq(p[0], "dhcp-option") && p[1] && !p[3]) + { + if (!(*update_options_found & OPT_P_U_DHCP)) + { + VERIFY_PERMISSION(OPT_P_DHCPDNS); + delete_all_dhcp_fo(options, &es->list); + *update_options_found |=3D OPT_P_U_DHCP; + } + } +#endif /* if defined(_WIN32) || defined(TARGET_ANDROID) */ + add_option(options, p, is_inline, file, line, + level, msglevel, permission_mask, + option_types_found, es); + return; +err: + msg(msglevel, "Error occurred trying to update %s option", p[0]); +} + bool apply_push_options(struct context *c, struct options *options, @@ -5765,6 +5996,7 @@ int line_num =3D 0; const char *file =3D "[PUSH-OPTIONS]"; const int msglevel =3D D_PUSH_ERRORS|M_OPTERR; + unsigned int update_options_found =3D 0; while (buf_parse(buf, ',', line, sizeof(line))) { @@ -5790,6 +6022,11 @@ remove_option(c, options, p, false, file, line_num, msglev= el, permission_mask, option_types_found, es); } + else + { + update_option(c, options, p, false, file, line_num, 0, msg= level, + permission_mask, option_types_found, es, &up= date_options_found); + } } } return true; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/810?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: Ia45c99e6df7b3ad24020c10b8a9b3577984ecdc2 Gerrit-Change-Number: 810 Gerrit-PatchSet: 13 Gerrit-Owner: mrbff Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-Reviewer: stipa Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Attention: mrbff Gerrit-MessageType: newpatchset --ftdkIf01rDw= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, mrbff, plaisthos. <= /p>

mrbff uploaded patch set #13 to this change.

View Change

The change is no longer submittable: checks~ChecksSubmitRule is un= satisfied now.

PUSH_UPDATE: Added update_option() function.

When the= function receives an option to update, it first checks whether it has
a= lready received an option of the same type within the same update message.<= br>If it has already received it, it simply calls add_option(), otherwise i= t
deletes all the values =E2=80=8B=E2=80=8Balready present regarding tha= t option.

Change-Id: Ia45c99e6df7b3ad24020c10b8a9b3577984ecdc2
Si= gned-off-by: Marco Baffo <marco@...2726...>
---
M src/openvpn/o= ptions.c
1 file changed, 247 insertions(+), 10 deletions(-)

gi=
t pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/10/810/13
<= pre style=3D"font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index b35f82b..4626747 100644
--- a/src/openvpn/options.c=
+++ b/src/openvpn/options.c
@@ -5560,6 +55= 60,13 @@
return options->forward_compatible ? M_WAR= N : msglevel;
}

+#define RESET_OPTION_ROUTES(option_ptr, fiel= d) \
+ if (option_= ptr) \
+ { \
+ option_ptr->field =3D NULL; = \
+ op= tion_ptr->flags =3D 0; \
+ }
+
/**
* @brief Resets options found= in the PUSH_UPDATE message that are preceded by the `-` flag.
* This function is used in push-updates to reset specified opt= ions.
@@ -5614,11 +5621,7 @@
d= elete_routes_v4(c->c1.route_list, c->c1.tuntap,
= ROUTE_OPTION_FLAGS(&c->options),
= es, &c->net_ctx);
- if (options->routes)<= /span>
- {- options->ro= utes->routes =3D NULL;
- options->routes->flags =3D 0;
- }
+ RESET_OPTION_ROUTES(options->rou= tes, routes);
}
}
<= span> else if (streq(p[0], "route-ipv6") && !p[1])

@@ -5629,11 +5632,7 @@
delete_ro= utes_v6(c->c1.route_ipv6_list, c->c1.tuntap,
= ROUTE_OPTION_FLAGS(&c->options),
es, &c->net_ctx);
- if (options->routes_ipv6= )
- {=
- options->= routes_ipv6->routes_ipv6 =3D NULL;
- options->routes_ipv6->flags =3D 0;
- }
= + RESET_OPTION_ROUTE= S(options->routes_ipv6, routes_ipv6);
}<= br> }
else if (streq(p[0], "route-gatew= ay") && !p[1])
@@ -5752,6 +5751,238 @@<= br> err:
msg(msglevel, "Error occurred tryi= ng to remove %s option", p[0]);
}
+
+/**
= + * @brief Processes an option to update. It first checks whether it has al= ready
+ * rece= ived an option of the same type within the same update message.
<= span style=3D"color: hsl(120, 100%, 40%);">+ * If the option has alr= eady been received, it calls add_option().

+ * Otherwise, it deletes all existing values = related to that option before calling add_option().
+ *
+ * @param c The context structure.
+ * @param options A pointer to the option= s structure.
+ * @par= am p An array of strings containing the options and their parameters.
+ * @param is_inline A boo= lean indicating if the option is inline.
+ * @param file The file where the function is called.<= /span>
+ * @param line The l= ine number where the function is called.
+ * @param level The level of the option.
+ * @param msglevel The message le= vel for logging.

+ * = @param permission_mask The permission mask used by VERIFY_PERMISSION().

+ * @param option_types_= found A pointer to the variable where the flags corresponding to the option= s found are stored.
+= * @param es The environment set structure.
+ * @param update_options_found A pointer to the var= iable where the flags corresponding to the update options found are stored,=
+ * = used to check if an option of the same type has already been pr= ocessed by update_option() within the same push-update message.
<= span style=3D"color: hsl(120, 100%, 40%);">+ */
+static void
+update_option(struct context *c,
+ struct options *options,
+ char *p[= ],
+ boo= l is_inline,
+ = const char *file,
+ int line,
+ const int level,
+ const int msglevel,
+ const unsigned int permissi= on_mask,
+ = unsigned int *option_types_found,
+ struct env_set *es,
+ unsigned int *update_options_f= ound)
+{
+ const bool pull_mode =3D BOO= L_CAST(permission_mask & OPT_P_PULL_MODE);

+ ASSERT(MAX_PARMS >=3D 7);
+
+ if (streq(p[0], "route") && p[1]= && !p[5])
+ = {
+ if (!(*= update_options_found & OPT_P_U_ROUTE))
+ {
+ VERIFY_PERMISSION(OPT_P_ROUTE);
+ rol_check_alloc(options);<= /span>
+ if (pull= _mode)
+ {=
+ if = (!ip_or_dns_addr_safe(p[1], options->allow_pull_fqdn) && !is_spe= cial_addr(p[1])) /* FQDN -- may be DNS name */
+ {
+ msg(msglevel, "route para= meter network/IP '%s' must be a valid address", p[1]);<= br>+ goto er= r;
+ }=
+ if = (p[2] && !ip_addr_dotted_quad_safe(p[2])) /* FQDN -- must be IP add= ress */
+ = {
+ = msg(msglevel, "route parameter netmask '%s' must be an I= P address", p[2]);
+ goto err;
+ }
+ if (p[3] && !ip_or_dns_addr_safe(p[3], = options->allow_pull_fqdn) && !is_special_addr(p[3])) /* FQDN -- = may be DNS name */
+ = {
+ = msg(msglevel, "route parameter gateway '%s' m= ust be a valid address", p[3]);
+ goto err;
+ }
+ }
+ if (c->c1.route_list)
+ {
+ delete_routes_v4(c->c1.rou= te_list, c->c1.tuntap,
+ ROUTE_OPTION_FLAGS(&c->option= s),
+ = es, &c->net_ctx);
+ RESET_OPTION_ROUTES(options->route= s, routes);
+ = }
+ *u= pdate_options_found |=3D OPT_P_U_ROUTE;
+ }
+ }
+ = else if (streq(p[0], "route-ipv6") && p[1] && !p[= 4])
+ {
= + if (!(*update_options_= found & OPT_P_U_ROUTE6))
+ {
+ = VERIFY_PERMISSION(OPT_P_ROUTE);
+ rol6_check_alloc(options);
+ if (pull_mode)
=
+ {
+ if (!ipv6_addr_s= afe_hexplusbits(p[1]))
= + msg(msglevel, "route-ipv6 parameter network/IP &#= 39;%s' must be a valid address", p[1]);
+ goto err;
+ }
+ if (p[2] && !i= pv6_addr_safe(p[2]))
= + {
+ = msg(msglevel, "route-ipv6 parameter gateway '%s= ' must be a valid address", p[2]);
+ goto err;
+ }
+ /* p[3] is metric, if pre= sent */
+ = }
+ if (c-= >c1.route_ipv6_list)
+ {
+ = delete_routes_v6(c->c1.route_ipv6_list, c->c1.tuntap,
+ = ROUTE_OPTION_FLAGS(&c->options),
+ es, &= ;c->net_ctx);
+ = RESET_OPTION_ROUTES(options->routes_ipv6, routes_ipv6);
+ }+ *update_options_f= ound |=3D OPT_P_U_ROUTE6;
+ }
+ = }
+ else if (streq= (p[0], "redirect-gateway") || streq(p[0], "redirect-private&= quot;))
+ {=
+ if (!(*update_opti= ons_found & OPT_P_U_REDIR_GATEWAY))
+ {
+ VERIFY_PERMISSION(OPT_P_ROUTE);
+ if (options->routes)

+ {
<= span style=3D"color: hsl(120, 100%, 40%);">+ options->rou= tes->flags =3D 0;
= + }
+ = if (options->routes_ipv6)
+ {
+ options->routes_ipv6->flags =3D 0;+ }
+ *update_options_found = |=3D OPT_P_U_REDIR_GATEWAY;
+ }
+ = }
+ else if (str= eq(p[0], "dns") && p[1])
+ {
+ if (!(*update_options_found & OPT_P_U_DNS))
= + {
+ VERIFY_PERMISSION(OPT_P_DHCP= DNS);
+ if= (streq(p[1], "server") && p[2] && p[3] &&= ; p[4])
+ = {
+ lo= ng priority;
+ = if (!dns_server_priority_parse(&priority, p[2], pull_mode))
+ {

+ msg(= msglevel, "--dns server: invalid priority value '%s'", p[= 2]);
+ = goto err;
+ = }
+=
+ struct dns= _server server;
+ = CLEAR(server);
+ if (streq(p[3], "address") && p[4]= )
+ {<= /span>
+ = for (int i =3D 4; p[i]; ++i)
+ {
+ if (!dns_server_addr_parse(&server, = p[i]))
+ = {
+ = msg(msglevel, "--dns server %ld: malformed addres= s or maximum exceeded '%s'", priority, p[i]);
+ goto err= ;
+ = }
+ = }
+ = }
+ = else if (streq(p[3], "dnssec") && !p[5])
+ {

+ if (!streq(p[4= ], "yes") && !streq(p[4], "no") && !str= eq(p[4], "optional"))
+ {
+ msg(msglevel, "--dns server %ld:= malformed dnssec value '%s'", priority, p[4]);
+ goto err;<= /span>
+ = }
+ }<= /span>
+ else= if (streq(p[3], "transport") && !p[5])
+ {
+ if (!streq(p[4], &q= uot;plain") && !streq(p[4], "DoH") && !streq= (p[4], "DoT"))
+ {
+ msg(msglevel, "--dns server %ld: malfor= med transport value '%s'", priority, p[4]);
+ goto err;

+ }
+ }

+ else if = (!streq(p[3], "resolve-domains")
+ && !(streq(p[3], &q= uot;sni") && !p[5]))
+ {
+ msg(msglevel, "--dns server %ld: unkno= wn option type '%s' or missing or unknown parameter", priority= , p[3]);
+ = goto err;
+ = }
+ = }
+ = else if (!(streq(p[1], "search-domains") && p[2]))
+ {+ msg(msglevel,= "--dns: unknown option type '%s' or missing or unknown parame= ter", p[1]);
+ = goto err;
+ }
+
+ gc_free(&= amp;options->dns_options.gc);
+ CLEAR(options->dns_options);
+ *update_options_found |=3D= OPT_P_U_DNS;
+ = }
+ }
= +#if defined(_WIN32) || defined= (TARGET_ANDROID)
+ = else if (streq(p[0], "dhcp-option") && p[1] && != p[3])
+ {+ if (!(*update_option= s_found & OPT_P_U_DHCP))
+ {
+ = struct tuntap_options *o =3D &options->tuntap_options;
+ VERIFY_PER= MISSION(OPT_P_DHCPDNS);
+
+ o-&= gt;domain =3D NULL;
+= o->netbios_scope =3D NULL;
+ o->netbios_node_type =3D 0;
= + o->dns6_len =3D= 0;
+ CLEA= R(o->dns6);
+ = o->dns_len =3D 0;
+ CLEAR(o->dns);
+ o->wins_len =3D 0;
+ CLEAR(o->wins);
= + o->ntp_len =3D = 0;
+ CLEAR= (o->ntp);
+ = o->nbdd_len =3D 0;
+ CLEAR(o->nbdd);
+ while (o->domain_search_list_len-- > 0)=
+ {
+ o->dom= ain_search_list[o->domain_search_list_len] =3D NULL;
+ }
+ o->disable_nbt =3D 0;+ o->dhcp_optio= ns =3D 0;
+#if define= d(TARGET_ANDROID)
+ = o->http_proxy_port =3D 0;
+ o->http_proxy =3D NULL;
+#endif
+ *update_options_found |=3D OPT_P_U_DHC= P;
+ }<= br>+ }
+#else /* if defined(_WIN32) || defined(TA= RGET_ANDROID) */
+ = else if (streq(p[0], "dhcp-option") && p[1] && != p[3])
+ {+ if (!(*update_option= s_found & OPT_P_U_DHCP))
+ {
+ = VERIFY_PERMISSION(OPT_P_DHCPDNS);
+ delete_all_dhcp_fo(options, &es-&g= t;list);
+ = *update_options_found |=3D OPT_P_U_DHCP;
+ }
+ }
+#e= ndif /* if defined(_WIN32) || defined(TARGET_ANDROID) */
+ add_option(options, p, is_inline, = file, line,
+ = level, msglevel, permission_mask,
+ option_types_found, es);
+ return;

+err:
+ msg(msglevel, "Error occurred trying to update = %s option", p[0]);
+}
+
bool

apply_push_options(struct context *c,
<= span> struct options *options,

@@ -5765,= 6 +5996,7 @@
int line_num =3D 0;
= const char *file =3D "[PUSH-OPTIONS]";
const= int msglevel =3D D_PUSH_ERRORS|M_OPTERR;
+ unsigned int update_options_found =3D 0;
while (buf_parse(buf, ',', line, siz= eof(line)))
{
@@ -5790,6 +6022,11 @@
remove_option(c, options, p, false, file, l= ine_num, msglevel,
permissio= n_mask, option_types_found, es);
}
<= span style=3D"color: hsl(120, 100%, 40%);">+ else

+ {

+ update_option(c, options= , p, false, file, line_num, 0, msglevel,
+ permission_mask, option_= types_found, es, &update_options_found);
+ }
} }
return true;

=

To view, visit change 810. To unsubscribe, or for help writing mail fil= ters, visit settings.

<= meta itemprop=3D"name" content=3D"View Change"/>
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia45c99e6df7b3ad24020c10b8a9= b3577984ecdc2
Gerrit-Change-Number: 810
Gerrit-PatchSet: 13
Gerrit-Owner: mrbff <marco@...2726...> <= /div>
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-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Attention: mrbff <marco@...2726...&g= t;
Gerrit-MessageType: newpatchset
--ftdkIf01rDw=--