diff options
-rw-r--r-- | toxcore/network.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/toxcore/network.c b/toxcore/network.c index d65e2077..2969f3ac 100644 --- a/toxcore/network.c +++ b/toxcore/network.c | |||
@@ -307,7 +307,7 @@ Networking_Core *new_networking(IP ip, uint16_t port) | |||
307 | fcntl(temp->sock, F_SETFL, O_NONBLOCK, 1); | 307 | fcntl(temp->sock, F_SETFL, O_NONBLOCK, 1); |
308 | #endif | 308 | #endif |
309 | 309 | ||
310 | /* Bind our socket to port PORT and address 0.0.0.0 */ | 310 | /* Bind our socket to port PORT and the given IP address (usually 0.0.0.0 or ::) */ |
311 | uint16_t *portptr = NULL; | 311 | uint16_t *portptr = NULL; |
312 | struct sockaddr_storage addr; | 312 | struct sockaddr_storage addr; |
313 | size_t addrsize; | 313 | size_t addrsize; |
@@ -371,7 +371,8 @@ Networking_Core *new_networking(IP ip, uint16_t port) | |||
371 | *portptr = htons(port); | 371 | *portptr = htons(port); |
372 | } | 372 | } |
373 | 373 | ||
374 | printf("Failed to bind socket: %s (IP/Port: %s:%u\n", strerror(errno), ip_ntoa(&ip), port); | 374 | fprintf(stderr, "Failed to bind socket: %u, %s (IP/Port: %s:%u\n", errno, |
375 | strerror(errno), ip_ntoa(&ip), port); | ||
375 | free(temp); | 376 | free(temp); |
376 | return NULL; | 377 | return NULL; |
377 | } | 378 | } |
@@ -436,7 +437,7 @@ void ip_reset(IP *ip) | |||
436 | return; | 437 | return; |
437 | 438 | ||
438 | #ifdef TOX_ENABLE_IPV6 | 439 | #ifdef TOX_ENABLE_IPV6 |
439 | memset(ip, 0, sizeof(*ip)); | 440 | memset(ip, 0, sizeof(IP)); |
440 | #else | 441 | #else |
441 | ip->uint32 = 0; | 442 | ip->uint32 = 0; |
442 | #endif | 443 | #endif |
@@ -449,7 +450,7 @@ void ip_init(IP *ip, uint8_t ipv6enabled) | |||
449 | return; | 450 | return; |
450 | 451 | ||
451 | #ifdef TOX_ENABLE_IPV6 | 452 | #ifdef TOX_ENABLE_IPV6 |
452 | memset(ip, 0, sizeof(ip)); | 453 | memset(ip, 0, sizeof(IP)); |
453 | ip->family = ipv6enabled ? AF_INET6 : AF_INET; | 454 | ip->family = ipv6enabled ? AF_INET6 : AF_INET; |
454 | #else | 455 | #else |
455 | ip->uint32 = 0; | 456 | ip->uint32 = 0; |