+Wed Sep 22 19:46:32 CEST 2004 Patrik Weiskircher <pat@icore.at>
+
+ * When using silc_net_create_connection[_async], and your system can
+ create IPv6 sockets, it will try to connect to the IPv6 host. Now it
+ tries to connect to an IPv4 host if IPv6 fails. Affected file
+ lib/silcutil/unix/silcunixnet.c
+
Fri Jun 18 19:26:58 CEST 2004 Pekka Riikonen <priikone@silcnet.org>
* Check for valid route when receiving packet from router and
/* Connect to the host */
rval = connect(sock, &desthost.sa, SIZEOF_SOCKADDR(desthost));
if (rval < 0) {
+ /* retry using an IPv4 adress, if IPv6 didn't work */
+ if (prefer_ipv6 && silc_net_is_ip6(ip_addr)) {
+ shutdown(sock, 2);
+ close(sock);
+
+ prefer_ipv6 = FALSE;
+ goto retry;
+ }
SILC_LOG_ERROR(("Cannot connect to remote host: %s", strerror(errno)));
shutdown(sock, 2);
close(sock);
rval = connect(sock, &desthost.sa, SIZEOF_SOCKADDR(desthost));
if (rval < 0) {
if (errno != EINPROGRESS) {
+ /* retry using an IPv4 adress, if IPv6 didn't work */
+ if (prefer_ipv6 && silc_net_is_ip6(ip_addr)) {
+ shutdown(sock, 2);
+ close(sock);
+
+ prefer_ipv6 = FALSE;
+ goto retry;
+ }
+
SILC_LOG_ERROR(("Cannot connect to remote host: %s", strerror(errno)));
shutdown(sock, 2);
close(sock);