free(inc);
inc = next;
}
- vpninfo->split_includes = vpninfo->split_excludes = NULL;
+ for (inc = vpninfo->split_dns; inc; ) {
+ struct split_include *next = inc->next;
+ free(inc);
+ inc = next;
+ }
+ vpninfo->split_dns = vpninfo->split_includes = vpninfo->split_excludes = NULL;
/* Create (new) random master key for DTLS connection, if needed */
if (vpninfo->dtls_times.last_rekey + vpninfo->dtls_times.rekey <
vpninfo->vpn_proxy_pac = new_option->value;
} else if (!strcmp(buf + 7, "Banner")) {
vpninfo->banner = new_option->value;
+ } else if (!strcmp(buf + 7, "Split-DNS")) {
+ struct split_include *dns = malloc(sizeof(*dns));
+ if (!dns)
+ continue;
+ dns->route = new_option->value;
+ dns->next = vpninfo->split_dns;
+ vpninfo->split_dns = dns;
} else if (!strcmp(buf + 7, "Split-Include")) {
struct split_include *inc = malloc(sizeof(*inc));
if (!inc)
const char *vpn_nbns[3];
const char *vpn_domain;
const char *vpn_proxy_pac;
+ struct split_include *split_dns;
struct split_include *split_includes;
struct split_include *split_excludes;
if (vpninfo->vpn_proxy_pac)
setenv("CISCO_PROXY_PAC", vpninfo->vpn_proxy_pac, 1);
+ if (vpninfo->split_dns) {
+ char *list;
+ int len = 0;
+ struct split_include *dns = vpninfo->split_dns;
+
+ while (dns) {
+ len += strlen(dns->route) + 1;
+ dns = dns->next;
+ }
+ list = malloc(len);
+ if (list) {
+ char *p = list;
+
+ dns = vpninfo->split_dns;
+ while (1) {
+ strcpy(p, dns->route);
+ p += strlen(p);
+ dns = dns->next;
+ if (!dns)
+ break;
+ *(p++) = ' ';
+ }
+ setenv("CISCO_SPLIT_DNS", list, 1);
+ free(list);
+ }
+ }
if (vpninfo->split_includes) {
struct split_include *this = vpninfo->split_includes;
int nr_split_includes = 0;