Commit 7d86a788 authored by David Woodhouse's avatar David Woodhouse

Rename and move cstp_free_splits

... to script.c which probably isn't the perfect place for it either, but
it *isn't* CSTP-specific.
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 6bdbab70
......@@ -123,29 +123,6 @@ static void calculate_mtu(struct openconnect_info *vpninfo, int *base_mtu, int *
*mtu = 1280;
}
void cstp_free_splits(struct openconnect_info *vpninfo)
{
struct oc_split_include *inc;
for (inc = vpninfo->ip_info.split_includes; inc; ) {
struct oc_split_include *next = inc->next;
free(inc);
inc = next;
}
for (inc = vpninfo->ip_info.split_excludes; inc; ) {
struct oc_split_include *next = inc->next;
free(inc);
inc = next;
}
for (inc = vpninfo->ip_info.split_dns; inc; ) {
struct oc_split_include *next = inc->next;
free(inc);
inc = next;
}
vpninfo->ip_info.split_dns = vpninfo->ip_info.split_includes =
vpninfo->ip_info.split_excludes = NULL;
}
/* if DTLS 1.2 is supported */
#if defined(DTLS_GNUTLS) && GNUTLS_VERSION_NUMBER >= 0x030200
# define DEFAULT_CIPHER_LIST "OC-DTLS1_2-AES256-GCM:OC-DTLS1_2-AES128-GCM:AES256-SHA:AES128-SHA:DES-CBC3-SHA:DES-CBC-SHA"
......@@ -200,7 +177,7 @@ static int start_cstp_connection(struct openconnect_info *vpninfo)
for (i = 0; i < 3; i++)
vpninfo->ip_info.dns[i] = vpninfo->ip_info.nbns[i] = NULL;
cstp_free_splits(vpninfo);
free_split_routes(vpninfo);
retry:
calculate_mtu(vpninfo, &base_mtu, &mtu);
......
......@@ -220,7 +220,7 @@ void openconnect_vpninfo_free(struct openconnect_info *vpninfo)
free_optlist(vpninfo->cookies);
free_optlist(vpninfo->cstp_options);
free_optlist(vpninfo->dtls_options);
cstp_free_splits(vpninfo);
free_split_routes(vpninfo);
free(vpninfo->hostname);
free(vpninfo->unique_hostname);
free(vpninfo->urlpath);
......
......@@ -650,6 +650,7 @@ int script_setenv_int(struct openconnect_info *vpninfo, const char *opt, int val
void prepare_script_env(struct openconnect_info *vpninfo);
int script_config_tun(struct openconnect_info *vpninfo, const char *reason);
int apply_script_env(struct oc_vpn_option *envs);
void free_split_routes(struct openconnect_info *vpninfo);
/* tun.c / tun-win32.c */
void os_shutdown_tun(struct openconnect_info *vpninfo);
......@@ -671,7 +672,6 @@ void cstp_common_headers(struct openconnect_info *vpninfo, struct oc_text_buf *b
int cstp_connect(struct openconnect_info *vpninfo);
int cstp_mainloop(struct openconnect_info *vpninfo, int *timeout);
int cstp_bye(struct openconnect_info *vpninfo, const char *reason);
void cstp_free_splits(struct openconnect_info *vpninfo);
int decompress_and_queue_packet(struct openconnect_info *vpninfo,
unsigned char *buf, int len);
int compress_packet(struct openconnect_info *vpninfo, int compr_type, struct pkt *this);
......
......@@ -328,6 +328,30 @@ void prepare_script_env(struct openconnect_info *vpninfo)
setenv_cstp_opts(vpninfo);
}
void free_split_routes(struct openconnect_info *vpninfo)
{
struct oc_split_include *inc;
for (inc = vpninfo->ip_info.split_includes; inc; ) {
struct oc_split_include *next = inc->next;
free(inc);
inc = next;
}
for (inc = vpninfo->ip_info.split_excludes; inc; ) {
struct oc_split_include *next = inc->next;
free(inc);
inc = next;
}
for (inc = vpninfo->ip_info.split_dns; inc; ) {
struct oc_split_include *next = inc->next;
free(inc);
inc = next;
}
vpninfo->ip_info.split_dns = vpninfo->ip_info.split_includes =
vpninfo->ip_info.split_excludes = NULL;
}
#ifdef _WIN32
static wchar_t *create_script_env(struct openconnect_info *vpninfo)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment