From: Nick Krylov Date: Thu, 14 Apr 2022 17:02:11 +0000 (+0300) Subject: Replace comma with space when multiple search domains specified. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=30d10be4ba38eb86ea3829b2c6fb92f3a70ab2da;p=users%2Fdwmw2%2Fopenconnect.git Replace comma with space when multiple search domains specified. --- diff --git a/cp.c b/cp.c index 084e5d59..cdbd0979 100644 --- a/cp.c +++ b/cp.c @@ -945,8 +945,11 @@ static int handle_hello_reply(const char *data, struct openconnect_info *vpninfo } opt = cpo_get(cpo, cpo_find_child(cpo, OM_idx, "dns_suffix")); - if (opt && opt->value && strlen(opt->value)) + if (opt && opt->value && strlen(opt->value)) { + /* Multiple values are comma-separated. Replace commas with spaces if any. */ + for (char* pos = opt->value; (pos = strchr(opt->value, ',')) != NULL; *pos = ' '); new_ip_info.domain = add_option_dup(&new_cstp_opts, "search", opt->value, -1); + } idx = cpo_find_child(cpo, OM_idx, "wins_servers"); if (idx >= 0) {