diff options
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index e18e9efc..48d40f43 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -650,15 +650,21 @@ static void LANdiscovery(Messenger *m) | |||
650 | } | 650 | } |
651 | 651 | ||
652 | /* Run this at startup. */ | 652 | /* Run this at startup. */ |
653 | Messenger *initMessenger(void) | 653 | Messenger *initMessenger(uint8_t ipv6enabled) |
654 | { | 654 | { |
655 | Messenger *m = calloc(1, sizeof(Messenger)); | 655 | Messenger *m = calloc(1, sizeof(Messenger)); |
656 | 656 | ||
657 | if ( ! m ) | 657 | if ( ! m ) |
658 | return NULL; | 658 | return NULL; |
659 | 659 | ||
660 | #ifdef NETWORK_IP_PORT_IS_IPV6 | ||
661 | IPAny ip; | ||
662 | memset(&ip, 0, sizeof(ip)); | ||
663 | ip.family = ipv6enabled ? AF_INET6 : AF_INET; | ||
664 | #else | ||
660 | IP4 ip; | 665 | IP4 ip; |
661 | ip.uint32 = 0; | 666 | ip.uint32 = 0; |
667 | #endif | ||
662 | m->net = new_networking(ip, PORT); | 668 | m->net = new_networking(ip, PORT); |
663 | 669 | ||
664 | if (m->net == NULL) { | 670 | if (m->net == NULL) { |