return setenv(opt, buf, 1);
}
+static void setenv_cstp_opts(struct openconnect_info *vpninfo)
+{
+ char *env_buf;
+ int buflen = 0;
+ int bufofs = 0;
+ struct vpn_option *opt;
+
+ for (opt = vpninfo->cstp_options; opt; opt = opt->next)
+ buflen += 2 + strlen(opt->option) + strlen(opt->value);
+
+ env_buf = malloc(buflen + 1);
+ if (!env_buf)
+ return;
+
+ env_buf[buflen] = 0;
+
+ for (opt = vpninfo->cstp_options; opt; opt = opt->next)
+ bufofs += snprintf(env_buf + bufofs, buflen - bufofs,
+ "%s=%s\n", opt->option, opt->value);
+
+ setenv("CISCO_CSTP_OPTIONS", env_buf, 1);
+ free(env_buf);
+}
+
static void set_script_env(struct openconnect_info *vpninfo)
{
struct sockaddr_in *sin = (void *)vpninfo->peer_addr;
}
setenv_int("CISCO_SPLIT_EXC", nr_split_excludes);
}
+ setenv_cstp_opts(vpninfo);
}
static int script_config_tun(struct openconnect_info *vpninfo)