From 2fd3e12e10939d66848a11004447a4a7873ea494 Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Tue, 9 Jan 2018 00:01:24 -0800 Subject: [PATCH] Fix compilation without HAVE_ESP, and conditionally compile more functions that are only used for ESP Signed-off-by: Daniel Lenski Signed-off-by: David Woodhouse --- gpst.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gpst.c b/gpst.c index 888b54af..306d6794 100644 --- a/gpst.c +++ b/gpst.c @@ -376,6 +376,7 @@ static int calculate_mtu(struct openconnect_info *vpninfo) return mtu; } +#ifdef HAVE_ESP static int set_esp_algo(struct openconnect_info *vpninfo, const char *s, int hmac) { if (hmac) { @@ -408,6 +409,7 @@ static int get_key_bits(xmlNode *xml_node, unsigned char *dest) } return (bits == 0) ? 0 : -EINVAL; } +#endif /* Return value: * < 0, on error @@ -665,7 +667,8 @@ static int gpst_connect(struct openconnect_info *vpninfo) monitor_read_fd(vpninfo, ssl); monitor_except_fd(vpninfo, ssl); vpninfo->ssl_times.last_rx = vpninfo->ssl_times.last_tx = time(NULL); - esp_close_secret(vpninfo); + if (vpninfo->proto->udp_close) + vpninfo->proto->udp_close(vpninfo); } return ret; @@ -1071,7 +1074,8 @@ int gpst_mainloop(struct openconnect_info *vpninfo, int *timeout) vpninfo->quit_reason = "GPST reconnect failed"; return ret; } - esp_setup(vpninfo, vpninfo->dtls_attempt_period); + if (vpninfo->proto->udp_setup) + vpninfo->proto->udp_setup(vpninfo, vpninfo->dtls_attempt_period); return 1; case KA_KEEPALIVE: -- 2.49.0