From 2f473300cd806af5cbe4939fe32c4faefba929e6 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 5 Mar 2014 06:01:10 +0000 Subject: [PATCH 1/2] Fixing fallback from IPv6 to IPv4 --- src/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 849408c..a8987fc 100644 --- a/src/main.c +++ b/src/main.c @@ -117,8 +117,10 @@ static Tox *init_tox(int ipv4) int ipv6 = !ipv4; Tox *m = tox_new(ipv6); - if (TOX_ENABLE_IPV6_DEFAULT && m == NULL) { - fprintf(stderr, "IPv6 didn't initialize, trying IPv4 only\n"); + // TOX_ENABLE_IPV6_DEFAULT is always 1. + // Fuck checking it, this *should* be doing ipv4 fallback, no? + if (ipv6 && m == NULL) { + fprintf(stderr, "IPv6 didn't initialize, trying IPv4\n"); m = tox_new(0); } From 2ae478d546c2089f07bd4cfdcfad19ed8b8cd24f Mon Sep 17 00:00:00 2001 From: "Michael R. Torres" Date: Wed, 5 Mar 2014 07:17:57 -0800 Subject: [PATCH 2/2] Fix fall-back from IPv6 to IPv4 Professionalism edits --- src/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index a8987fc..73defee 100644 --- a/src/main.c +++ b/src/main.c @@ -117,8 +117,10 @@ static Tox *init_tox(int ipv4) int ipv6 = !ipv4; Tox *m = tox_new(ipv6); - // TOX_ENABLE_IPV6_DEFAULT is always 1. - // Fuck checking it, this *should* be doing ipv4 fallback, no? + /* + * TOX_ENABLE_IPV6_DEFAULT is always 1. + * Checking it is redundant, this *should* be doing ipv4 fallback + */ if (ipv6 && m == NULL) { fprintf(stderr, "IPv6 didn't initialize, trying IPv4\n"); m = tox_new(0);