summaryrefslogtreecommitdiff
path: root/toxcore/network.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/network.c')
-rw-r--r--toxcore/network.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/toxcore/network.c b/toxcore/network.c
index 22ee4202..965e65f9 100644
--- a/toxcore/network.c
+++ b/toxcore/network.c
@@ -266,7 +266,7 @@ uint64_t current_time_monotonic(void)
266} 266}
267 267
268/* In case no logging */ 268/* In case no logging */
269#ifndef LOGGING 269#ifndef TOX_LOGGER
270#define loglogdata(__message__, __buffer__, __buflen__, __ip_port__, __res__) 270#define loglogdata(__message__, __buffer__, __buflen__, __ip_port__, __res__)
271#else 271#else
272#define data_0(__buflen__, __buffer__) __buflen__ > 4 ? ntohl(*(uint32_t *)&__buffer__[1]) : 0 272#define data_0(__buflen__, __buffer__) __buflen__ > 4 ? ntohl(*(uint32_t *)&__buffer__[1]) : 0
@@ -287,7 +287,7 @@ uint64_t current_time_monotonic(void)
287 __buffer__[0], __message__, (size_t)__res__, (!__res__ ? '!' : '>'), __buflen__, \ 287 __buffer__[0], __message__, (size_t)__res__, (!__res__ ? '!' : '>'), __buflen__, \
288 ip_ntoa(&((__ip_port__).ip)), ntohs((__ip_port__).port), 0, "OK", data_0(__buflen__, __buffer__), data_1(__buflen__, __buffer__)); 288 ip_ntoa(&((__ip_port__).ip)), ntohs((__ip_port__).port), 0, "OK", data_0(__buflen__, __buffer__), data_1(__buflen__, __buffer__));
289 289
290#endif /* LOGGING */ 290#endif /* TOX_LOGGER */
291 291
292/* Basic network functions: 292/* Basic network functions:
293 * Function to send packet(data) of length length to ip_port. 293 * Function to send packet(data) of length length to ip_port.
@@ -615,9 +615,9 @@ Networking_Core *new_networking_ex(IP ip, uint16_t port_from, uint16_t port_to,
615 } 615 }
616 616
617 if (ip.family == AF_INET6) { 617 if (ip.family == AF_INET6) {
618#ifdef LOGGING 618#ifdef TOX_LOGGER
619 int is_dualstack = 619 int is_dualstack =
620#endif /* LOGGING */ 620#endif /* TOX_LOGGER */
621 set_socket_dualstack(temp->sock); 621 set_socket_dualstack(temp->sock);
622 LOGGER_DEBUG( "Dual-stack socket: %s", 622 LOGGER_DEBUG( "Dual-stack socket: %s",
623 is_dualstack ? "enabled" : "Failed to enable, won't be able to receive from/send to IPv4 addresses" ); 623 is_dualstack ? "enabled" : "Failed to enable, won't be able to receive from/send to IPv4 addresses" );
@@ -628,9 +628,9 @@ Networking_Core *new_networking_ex(IP ip, uint16_t port_from, uint16_t port_to,
628 mreq.ipv6mr_multiaddr.s6_addr[ 1] = 0x02; 628 mreq.ipv6mr_multiaddr.s6_addr[ 1] = 0x02;
629 mreq.ipv6mr_multiaddr.s6_addr[15] = 0x01; 629 mreq.ipv6mr_multiaddr.s6_addr[15] = 0x01;
630 mreq.ipv6mr_interface = 0; 630 mreq.ipv6mr_interface = 0;
631#ifdef LOGGING 631#ifdef TOX_LOGGER
632 int res = 632 int res =
633#endif /* LOGGING */ 633#endif /* TOX_LOGGER */
634 setsockopt(temp->sock, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, (char *)&mreq, sizeof(mreq)); 634 setsockopt(temp->sock, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, (char *)&mreq, sizeof(mreq));
635 635
636 LOGGER_DEBUG(res < 0 ? "Failed to activate local multicast membership. (%u, %s)" : 636 LOGGER_DEBUG(res < 0 ? "Failed to activate local multicast membership. (%u, %s)" :