aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/pthsem/Makefile36
-rw-r--r--net/knxd/Makefile144
-rw-r--r--net/linknx/Makefile40
-rw-r--r--net/openconnect/Makefile6
-rw-r--r--net/openconnect/patches/001-always-resolve-ips.patch143
5 files changed, 113 insertions, 256 deletions
diff --git a/libs/pthsem/Makefile b/libs/pthsem/Makefile
index a36bc0296..0dee689c9 100644
--- a/libs/pthsem/Makefile
+++ b/libs/pthsem/Makefile
@@ -39,30 +39,30 @@ define Package/pthsem/description
endef
MAKE_FLAGS += \
- OPTIM="$(TARGET_CFLAGS)" \
- CFLAGS="$(TARGET_CFLAGS)" \
- DESTDIR="$(PKG_INSTALL_DIR)"
+ OPTIM="$(TARGET_CFLAGS)" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ DESTDIR="$(PKG_INSTALL_DIR)"
define Build/InstallDev
- $(INSTALL_DIR) $(2)/bin
- $(INSTALL_BIN) \
- $(PKG_INSTALL_DIR)/usr/bin/pthsem-config \
- $(2)/bin/
- $(SED) \
- 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
- $(2)/bin/pthsem-config
+ $(INSTALL_DIR) $(2)/bin
+ $(INSTALL_BIN) \
+ $(PKG_INSTALL_DIR)/usr/bin/pthsem-config \
+ $(2)/bin/
+ $(SED) \
+ 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
+ $(2)/bin/pthsem-config
- $(INSTALL_DIR) $(1)/usr/include
- $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h \
- $(1)/usr/include/
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpthsem.{a,la,so*} \
- $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h \
+ $(1)/usr/include/
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpthsem.{a,la,so*} \
+ $(1)/usr/lib/
endef
define Package/pthsem/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpthsem.so.* $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpthsem.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,pthsem))
diff --git a/net/knxd/Makefile b/net/knxd/Makefile
index 4fe4710d6..bf53e5aab 100644
--- a/net/knxd/Makefile
+++ b/net/knxd/Makefile
@@ -63,93 +63,93 @@ define Package/knxd-tools/description
EIB KNX Tools
endef
define Build/Prepare
- $(call Build/Prepare/Default)
+ $(call Build/Prepare/Default)
endef
define Build/Configure
- $(call Build/Configure/Default,\
- --disable-ft12 \
- --enable-eibnetip \
- --enable-eibnetiptunnel \
- --enable-eibnetipserver \
- --disable-usb \
- --enable-tpuart \
- --enable-tpuarts \
- --disable-pei16 \
- --disable-pei16s \
- --enable-groupcache \
- --without-pth-test \
- --without-libstdc )
+ $(call Build/Configure/Default,\
+ --disable-ft12 \
+ --enable-eibnetip \
+ --enable-eibnetiptunnel \
+ --enable-eibnetipserver \
+ --disable-usb \
+ --enable-tpuart \
+ --enable-tpuarts \
+ --disable-pei16 \
+ --disable-pei16s \
+ --enable-groupcache \
+ --without-pth-test \
+ --without-libstdc )
endef
define Build/Compile
- $(MAKE) -C $(PKG_BUILD_DIR) \
- CC=$(TARGET_CC) \
- LIBS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib -fno-builtin -nostdinc++ -nodefaultlibs -lc -lm -lgcc -largp -lpthsem" \
- CPPFLAGS="-I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include"
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ CC=$(TARGET_CC) \
+ LIBS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib -fno-builtin -nostdinc++ -nodefaultlibs -lc -lm -lgcc -largp -lpthsem" \
+ CPPFLAGS="-I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include"
endef
define Package/knxd/install
- mkdir -p $(1)/usr/bin
- $(CP) $(PKG_BUILD_DIR)/src/server/knxd $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/tools/bcu/bcuaddrtab $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/tools/bcu/bcuread $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/tools/eibnet/eibnetsearch $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/tools/eibnet/eibnetdescribe $(1)/usr/bin/
- mkdir -p $(1)/etc/init.d
- $(CP) ./files/knxd.init $(1)/etc/init.d/knxd
- mkdir -p $(1)/etc/config
- $(CP) ./files/knxd.config $(1)/etc/config/knxd
+ mkdir -p $(1)/usr/bin
+ $(CP) $(PKG_BUILD_DIR)/src/server/knxd $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/tools/bcu/bcuaddrtab $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/tools/bcu/bcuread $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/tools/eibnet/eibnetsearch $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/tools/eibnet/eibnetdescribe $(1)/usr/bin/
+ mkdir -p $(1)/etc/init.d
+ $(CP) ./files/knxd.init $(1)/etc/init.d/knxd
+ mkdir -p $(1)/etc/config
+ $(CP) ./files/knxd.config $(1)/etc/config/knxd
endef
# add this line above to support USB
# $(CP) $(PKG_BUILD_DIR)/src/usb/findknxusb $(1)/usr/bin/
define Package/knxd-tools/install
- mkdir -p $(1)/usr/lib
- $(CP) $(PKG_BUILD_DIR)/src/client/c/.libs/libeibclient.so.0.0.0 $(1)/usr/lib/
- ln -s libeibclient.so.0.0.0 $(1)/usr/lib/libeibclient.so
- ln -s libeibclient.so.0.0.0 $(1)/usr/lib/libeibclient.so.0
- mkdir -p $(1)/usr/bin
- -rm -f $(1)/usr/bin/knxread
- -rm -f $(1)/usr/bin/knxreadtemp
- -rm -f $(1)/usr/bin/knxwrite
- -rm -f $(1)/usr/bin/knxlog
- -rm -f $(1)/usr/bin/knxon
- -rm -f $(1)/usr/bin/knxoff
- -rm -f $(1)/usr/bin/knxif
- -rm -f $(1)/usr/bin/knxswrite
- -rm -f $(1)/usr/bin/knxbool
- -rm -f $(1)/usr/bin/knxdimup
- ln -s knxtool $(1)/usr/bin/knxread
- ln -s knxtool $(1)/usr/bin/knxreadtemp
- ln -s knxtool $(1)/usr/bin/knxwrite
- ln -s knxtool $(1)/usr/bin/knxlog
- ln -s knxtool $(1)/usr/bin/knxon
- ln -s knxtool $(1)/usr/bin/knxoff
- ln -s knxtool $(1)/usr/bin/knxif
- ln -s knxtool $(1)/usr/bin/knxswrite
- ln -s knxtool $(1)/usr/bin/knxbool
- ln -s knxtool $(1)/usr/bin/knxdimup
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/knxtool $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/busmonitor1 $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/busmonitor2 $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/busmonitor3 $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/eibread-cgi $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/eibwrite-cgi $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/vbusmonitor1 $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/vbusmonitor2 $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/vbusmonitor3 $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupwrite $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupswrite $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/grouplisten $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupread $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupresponse $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupreadresponse $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupsocketlisten $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupsocketread $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupsocketwrite $(1)/usr/bin/
- $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupsocketswrite $(1)/usr/bin/
+ mkdir -p $(1)/usr/lib
+ $(CP) $(PKG_BUILD_DIR)/src/client/c/.libs/libeibclient.so.0.0.0 $(1)/usr/lib/
+ ln -s libeibclient.so.0.0.0 $(1)/usr/lib/libeibclient.so
+ ln -s libeibclient.so.0.0.0 $(1)/usr/lib/libeibclient.so.0
+ mkdir -p $(1)/usr/bin
+ -rm -f $(1)/usr/bin/knxread
+ -rm -f $(1)/usr/bin/knxreadtemp
+ -rm -f $(1)/usr/bin/knxwrite
+ -rm -f $(1)/usr/bin/knxlog
+ -rm -f $(1)/usr/bin/knxon
+ -rm -f $(1)/usr/bin/knxoff
+ -rm -f $(1)/usr/bin/knxif
+ -rm -f $(1)/usr/bin/knxswrite
+ -rm -f $(1)/usr/bin/knxbool
+ -rm -f $(1)/usr/bin/knxdimup
+ ln -s knxtool $(1)/usr/bin/knxread
+ ln -s knxtool $(1)/usr/bin/knxreadtemp
+ ln -s knxtool $(1)/usr/bin/knxwrite
+ ln -s knxtool $(1)/usr/bin/knxlog
+ ln -s knxtool $(1)/usr/bin/knxon
+ ln -s knxtool $(1)/usr/bin/knxoff
+ ln -s knxtool $(1)/usr/bin/knxif
+ ln -s knxtool $(1)/usr/bin/knxswrite
+ ln -s knxtool $(1)/usr/bin/knxbool
+ ln -s knxtool $(1)/usr/bin/knxdimup
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/knxtool $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/busmonitor1 $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/busmonitor2 $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/busmonitor3 $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/eibread-cgi $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/eibwrite-cgi $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/vbusmonitor1 $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/vbusmonitor2 $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/vbusmonitor3 $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupwrite $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupswrite $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/grouplisten $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupread $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupresponse $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupreadresponse $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupsocketlisten $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupsocketread $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupsocketwrite $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupsocketswrite $(1)/usr/bin/
endef
$(eval $(call BuildPackage,knxd))
diff --git a/net/linknx/Makefile b/net/linknx/Makefile
index 3c188580d..066b50910 100644
--- a/net/linknx/Makefile
+++ b/net/linknx/Makefile
@@ -12,7 +12,7 @@ PKG_VERSION:=0.0.1.32
PKG_RELEASE:=1
PKG_MD5SUM:=7ecc1208f59bceb05068c752b2250b63
-PKG_MAINTAINER:=Othmar Truniger <tru7@users.noreply.github.com>
+PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE_URL:=@SF/linknx
@@ -32,31 +32,31 @@ define Package/linknx
endef
define Build/Configure
- (cd $(PKG_BUILD_DIR); touch aclocal.m4 Makefile.in config.h.in configure; \
- $(SED) 's,\"2.0.4\",\"2.0.4\"\n_pth_version=\"2.0.8\",g' $(PKG_BUILD_DIR)/configure )
- $(call Build/Configure/Default,--verbose --without-pth-test --with-pth=$(STAGING_DIR) --without-log4cpp --with-lua --with-libcurl --without-mysql, \
- CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -lcrypt" \
- )
+ (cd $(PKG_BUILD_DIR); touch aclocal.m4 Makefile.in config.h.in configure; \
+ $(SED) 's,\"2.0.4\",\"2.0.4\"\n_pth_version=\"2.0.8\",g' $(PKG_BUILD_DIR)/configure )
+ $(call Build/Configure/Default,--verbose --without-pth-test --with-pth=$(STAGING_DIR) --without-log4cpp --with-lua --with-libcurl --without-mysql, \
+ CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -lcrypt" \
+ )
endef
define Build/Compile
- $(MAKE) -C $(PKG_BUILD_DIR)/ \
- LIBDIR="$(TARGET_LDFLAGS)" \
- CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) " \
- LD="$(TARGET_CROSS)ld -shared" \
- LUA="$(STAGING_DIR_HOST)/bin/lua" \
- LUAC="$(STAGING_DIR_HOST)/bin/luac" \
- CFLAGS="$(TARGET_CFLAGS) -nodefaultlibs" all
+ $(MAKE) -C $(PKG_BUILD_DIR)/ \
+ LIBDIR="$(TARGET_LDFLAGS)" \
+ CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) " \
+ LD="$(TARGET_CROSS)ld -shared" \
+ LUA="$(STAGING_DIR_HOST)/bin/lua" \
+ LUAC="$(STAGING_DIR_HOST)/bin/luac" \
+ CFLAGS="$(TARGET_CFLAGS) -nodefaultlibs" all
endef
define Package/linknx/install
- mkdir -p $(1)/usr/bin
- $(CP) $(PKG_BUILD_DIR)/src/linknx $(1)/usr/bin/
- mkdir -p $(1)/etc/init.d
- $(CP) ./files/linknx.init $(1)/etc/init.d/linknx
- mkdir -p $(1)/etc/config
- $(CP) ./files/linknx.config $(1)/etc/config/linknx
- $(CP) ./files/linknx.xml.dist $(1)/etc/linknx.xml.dist
+ mkdir -p $(1)/usr/bin
+ $(CP) $(PKG_BUILD_DIR)/src/linknx $(1)/usr/bin/
+ mkdir -p $(1)/etc/init.d
+ $(CP) ./files/linknx.init $(1)/etc/init.d/linknx
+ mkdir -p $(1)/etc/config
+ $(CP) ./files/linknx.config $(1)/etc/config/linknx
+ $(CP) ./files/linknx.xml.dist $(1)/etc/linknx.xml.dist
endef
$(eval $(call BuildPackage,linknx))
diff --git a/net/openconnect/Makefile b/net/openconnect/Makefile
index 6bd402f34..7b6410d26 100644
--- a/net/openconnect/Makefile
+++ b/net/openconnect/Makefile
@@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=openconnect
-PKG_VERSION:=7.00
-PKG_RELEASE:=4
+PKG_VERSION:=7.02
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/openconnect/
-PKG_MD5SUM:=208b03fb66cd8e26633a19b9e12f35af
+PKG_MD5SUM:=d2498cfa1020be4665a7317dc1bf04b0
PKG_CONFIG_DEPENDS:= \
CONFIG_OPENCONNECT_GNUTLS \
diff --git a/net/openconnect/patches/001-always-resolve-ips.patch b/net/openconnect/patches/001-always-resolve-ips.patch
deleted file mode 100644
index 809dd23db..000000000
--- a/net/openconnect/patches/001-always-resolve-ips.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-From 2f55fec323730a94ed49d401d93b913d85e43b65 Mon Sep 17 00:00:00 2001
-From: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-Date: Mon, 1 Dec 2014 20:10:06 +0100
-Subject: [PATCH 1/2] Re-resolve when reconnecting CSTP and the X-CSTP-DynDNS
- is set by the server
-
-That is, when reconnecting CSTP due to peer tearing the connection
-down attempt to re-resolve its IP. That handles the case where
-the server is using dynamic DNS and is advertising it.
-
-[dwmw2: refactored to simplify it somewhat]
-
-Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
----
- cstp.c | 3 +++
- openconnect-internal.h | 1 +
- ssl.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
- 4 files changed, 52 insertions(+), 2 deletions(-)
-
-diff --git a/cstp.c b/cstp.c
-index 3b93538..55225f4 100644
---- a/cstp.c
-+++ b/cstp.c
-@@ -378,6 +378,9 @@ static int start_cstp_connection(struct openconnect_info *vpninfo)
- int cstpmtu = atol(colon);
- if (cstpmtu > mtu)
- mtu = cstpmtu;
-+ } else if (!strcmp(buf + 7, "DynDNS")) {
-+ if (!strcmp(colon, "true"))
-+ vpninfo->is_dyndns = 1;
- } else if (!strcmp(buf + 7, "Address-IP6")) {
- vpninfo->ip_info.netmask6 = new_option->value;
- } else if (!strcmp(buf + 7, "Address")) {
-diff --git a/openconnect-internal.h b/openconnect-internal.h
-index 1bc79e5..db6c2ba 100644
---- a/openconnect-internal.h
-+++ b/openconnect-internal.h
-@@ -427,6 +427,7 @@ struct openconnect_info {
- int dtls_local_port;
-
- int deflate;
-+ int is_dyndns; /* Attempt to redo DNS lookup on each CSTP reconnect */
- char *useragent;
-
- const char *quit_reason;
-diff --git a/ssl.c b/ssl.c
-index b50652d..d47a819 100644
---- a/ssl.c
-+++ b/ssl.c
-@@ -106,6 +106,23 @@ unsigned string_is_hostname(const char *str)
- return 1;
- }
-
-+static int match_sockaddr(struct sockaddr *a, struct sockaddr *b)
-+{
-+ if (a->sa_family == AF_INET) {
-+ struct sockaddr_in *a4 = (void *)a;
-+ struct sockaddr_in *b4 = (void *)b;
-+
-+ return (a4->sin_addr.s_addr == b4->sin_addr.s_addr) &&
-+ (a4->sin_port == b4->sin_port);
-+ } else if (a->sa_family == AF_INET6) {
-+ struct sockaddr_in6 *a6 = (void *)a;
-+ struct sockaddr_in6 *b6 = (void *)b;
-+ return !memcmp(&a6->sin6_addr, &b6->sin6_addr, sizeof(a6->sin6_addr) &&
-+ a6->sin6_port == b6->sin6_port);
-+ } else
-+ return 0;
-+}
-+
- int connect_https_socket(struct openconnect_info *vpninfo)
- {
- int ssl_sock = -1;
-@@ -114,7 +131,11 @@ int connect_https_socket(struct openconnect_info *vpninfo)
- if (!vpninfo->port)
- vpninfo->port = 443;
-
-- if (vpninfo->peer_addr) {
-+ /* If we're talking to a server which told us it has dynamic DNS, don't
-+ just re-use its previous IP address. If we're talking to a proxy, we
-+ can use *its* previous IP address. We expect it'll re-do the DNS
-+ lookup for the server anyway. */
-+ if (vpninfo->peer_addr && (!vpninfo->is_dyndns || vpninfo->proxy)) {
- reconnect:
- #ifdef SOCK_CLOEXEC
- ssl_sock = socket(vpninfo->peer_addr->sa_family, SOCK_STREAM | SOCK_CLOEXEC, IPPROTO_IP);
-@@ -230,6 +251,13 @@ int connect_https_socket(struct openconnect_info *vpninfo)
- if (hints.ai_flags & AI_NUMERICHOST)
- free(hostname);
- ssl_sock = -EINVAL;
-+ /* If we were just retrying for dynamic DNS, reconnct using
-+ the previously-known IP address */
-+ if (vpninfo->peer_addr) {
-+ vpn_progress(vpninfo, PRG_ERR,
-+ _("Reconnecting to DynDNS server using previously cached IP address\n"));
-+ goto reconnect;
-+ }
- goto out;
- }
- if (hints.ai_flags & AI_NUMERICHOST)
-@@ -257,6 +285,8 @@ int connect_https_socket(struct openconnect_info *vpninfo)
- if (cancellable_connect(vpninfo, ssl_sock, rp->ai_addr, rp->ai_addrlen) >= 0) {
- /* Store the peer address we actually used, so that DTLS can
- use it again later */
-+ free(vpninfo->peer_addr);
-+ vpninfo->peer_addrlen = 0;
- vpninfo->peer_addr = malloc(rp->ai_addrlen);
- if (!vpninfo->peer_addr) {
- vpn_progress(vpninfo, PRG_ERR,
-@@ -288,6 +318,17 @@ int connect_https_socket(struct openconnect_info *vpninfo)
- }
- closesocket(ssl_sock);
- ssl_sock = -1;
-+
-+ /* If we're in DynDNS mode but this *was* the cached IP address,
-+ * don't bother falling back to it if it didn't work. */
-+ if (vpninfo->peer_addr && vpninfo->peer_addrlen == rp->ai_addrlen &&
-+ match_sockaddr(vpninfo->peer_addr, rp->ai_addr)) {
-+ vpn_progress(vpninfo, PRG_TRACE,
-+ _("Forgetting non-functional previous peer address\n"));
-+ free(vpninfo->peer_addr);
-+ vpninfo->peer_addr = 0;
-+ vpninfo->peer_addrlen = 0;
-+ }
- }
- freeaddrinfo(result);
-
-@@ -296,6 +337,11 @@ int connect_https_socket(struct openconnect_info *vpninfo)
- _("Failed to connect to host %s\n"),
- vpninfo->proxy?:vpninfo->hostname);
- ssl_sock = -EINVAL;
-+ if (vpninfo->peer_addr) {
-+ vpn_progress(vpninfo, PRG_ERR,
-+ _("Reconnecting to DynDNS server using previously cached IP address\n"));
-+ goto reconnect;
-+ }
- goto out;
- }
- }
---
-2.1.3
-