From: David Woodhouse Date: Wed, 29 Apr 2009 13:04:26 +0000 (+0100) Subject: Support proxy autoconfiguration X-Git-Tag: v1.20~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4cf7198e12c963968dab87e1347f6c25b92fd08f;p=platform%2Fupstream%2Fopenconnect.git Support proxy autoconfiguration Signed-off-by: David Woodhouse --- diff --git a/cstp.c b/cstp.c index 534bddb..5e8e41c 100644 --- a/cstp.c +++ b/cstp.c @@ -78,6 +78,8 @@ static int start_cstp_connection(struct openconnect_info *vpninfo) /* Clear old options which will be overwritten */ vpninfo->vpn_addr = vpninfo->vpn_netmask = NULL; vpninfo->cstp_options = vpninfo->dtls_options = NULL; + vpninfo->vpn_domain = vpninfo->vpn_proxy_pac = NULL; + for (i=0; i<3; i++) vpninfo->vpn_dns[i] = vpninfo->vpn_nbns[i] = NULL; @@ -233,6 +235,8 @@ static int start_cstp_connection(struct openconnect_info *vpninfo) } } else if (!strcmp(buf + 7, "Default-Domain")) { vpninfo->vpn_domain = new_option->value; + } else if (!strcmp(buf + 7, "MSIE-Proxy-PAC-URL")) { + vpninfo->vpn_proxy_pac = new_option->value; } else if (!strcmp(buf + 7, "Split-Include")) { struct split_include *inc = malloc(sizeof(*inc)); if (!inc) diff --git a/openconnect.h b/openconnect.h index cb8dd55..d1d7d95 100644 --- a/openconnect.h +++ b/openconnect.h @@ -185,6 +185,7 @@ struct openconnect_info { const char *vpn_dns[3]; const char *vpn_nbns[3]; const char *vpn_domain; + const char *vpn_proxy_pac; struct split_include *split_includes; struct split_include *split_excludes; diff --git a/tun.c b/tun.c index afd8af9..2bf248b 100644 --- a/tun.c +++ b/tun.c @@ -185,6 +185,9 @@ static void set_script_env(struct openconnect_info *vpninfo) setenv("CISCO_DEF_DOMAIN", vpninfo->vpn_domain, 1); else unsetenv ("CISCO_DEF_DOMAIN"); + if (vpninfo->vpn_proxy_pac) + setenv("CISCO_PROXY_PAC", vpninfo->vpn_proxy_pac, 1); + if (vpninfo->split_includes) { struct split_include *this = vpninfo->split_includes; int nr_split_includes = 0;