summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiadlo <polsha3@gmail.com>2017-03-04 08:59:52 +0300
committerDiadlo <polsha3@gmail.com>2017-03-04 15:32:00 +0300
commitf91af5c93a46b7290bfbcc83ef0bc94382a64938 (patch)
tree6ce047d6327c90646b2bfb680c2e43a2fc58fef1
parentdef92ab029c027af7d9c0f90699e39fff3b48794 (diff)
Move 'family' copying after all address checks
Fix #495
-rw-r--r--toxcore/network.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/network.c b/toxcore/network.c
index 8008156b..92a04276 100644
--- a/toxcore/network.c
+++ b/toxcore/network.c
@@ -1242,8 +1242,6 @@ int32_t net_getipport(const char* node, IP_Port** res, int type)
1242 1242
1243 IP_Port *ip_port = *res; 1243 IP_Port *ip_port = *res;
1244 for (cur = infos; cur != NULL; cur = cur->ai_next) { 1244 for (cur = infos; cur != NULL; cur = cur->ai_next) {
1245 ip_port->ip.family = cur->ai_family;
1246
1247 if (cur->ai_socktype && type > 0 && cur->ai_socktype != type) { 1245 if (cur->ai_socktype && type > 0 && cur->ai_socktype != type) {
1248 continue; 1246 continue;
1249 } 1247 }
@@ -1258,6 +1256,8 @@ int32_t net_getipport(const char* node, IP_Port** res, int type)
1258 continue; 1256 continue;
1259 } 1257 }
1260 1258
1259 ip_port->ip.family = cur->ai_family;
1260
1261 ip_port++; 1261 ip_port++;
1262 } 1262 }
1263 1263