Using globalprotect protocol, if we receive XML with: <dns-suffix> <member>apple.foo.bar</member> <member>orange.foo.bar</member> <member>banana.foo.bar</member> </dns-suffix> CISCO_DEF_DOMAIN environment variable sent to vpnc-script will only contain the first domain "apple.foo.bar." This patch combines them all into one single space-separated string (this behavior matches that of pulse protocol, but I don't have cisco VPN to test behavior there). Signed-off-by: Daniel Sampliner <samplinerd at gmail.com> --- gpst.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gpst.c b/gpst.c index 2f029d21..6a48294a 100644 --- a/gpst.c +++ b/gpst.c @@ -517,11 +517,16 @@ static int gpst_parse_config_xml(struct openconnect_info *vpninfo, xmlNode *xml_ if (!xmlnode_get_text(member, "member", &s)) vpninfo->ip_info.nbns[ii++] = add_option(vpninfo, "WINS", s); } else if (xmlnode_is_named(xml_node, "dns-suffix")) { - for (ii=0, member = xml_node->children; member && ii<1; member=member->next) + FILE *stream; + char *buf; + size_t len; + stream = open_memstream(&buf, &len); + for (member = xml_node->children; member; member=member->next) if (!xmlnode_get_text(member, "member", &s)) { - vpninfo->ip_info.domain = add_option(vpninfo, "search", s); - ii++; + fprintf(stream, "%s ", s); } + fclose(stream); + vpninfo->ip_info.domain = add_option(vpninfo, "search", buf); } else if (xmlnode_is_named(xml_node, "access-routes")) { for (member = xml_node->children; member; member=member->next) { if (!xmlnode_get_text(member, "member", &s)) { -- 2.19.0