summaryrefslogtreecommitdiff
path: root/toxcore/LAN_discovery.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-08-30 08:16:34 -0400
committerirungentoo <irungentoo@gmail.com>2013-08-30 08:16:34 -0400
commit8f0bef5f20e5f9518889010387edce4d3af9b3dc (patch)
tree87e8f2e3d9fbdd223def556698ef9952b8620ce3 /toxcore/LAN_discovery.c
parent7441a234b7f6dae025819bc2717026d6462e151a (diff)
Fixed warnings and moved hex_string_to_bin to testing/
Diffstat (limited to 'toxcore/LAN_discovery.c')
-rw-r--r--toxcore/LAN_discovery.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c
index cb27c024..33570c73 100644
--- a/toxcore/LAN_discovery.c
+++ b/toxcore/LAN_discovery.c
@@ -117,7 +117,8 @@ static int LAN_ip(IP ip)
117 if (ip.uint8[0] == 192 && ip.uint8[1] == 168) /* 192.168.0.0 to 192.168.255.255 range. */ 117 if (ip.uint8[0] == 192 && ip.uint8[1] == 168) /* 192.168.0.0 to 192.168.255.255 range. */
118 return 0; 118 return 0;
119 119
120 if (ip.uint8[0] == 169 && ip.uint8[1] == 254 && ip.uint8[2] != 0 && ip.uint8[2] != 255)/* 169.254.1.0 to 169.254.254.255 range. */ 120 if (ip.uint8[0] == 169 && ip.uint8[1] == 254 && ip.uint8[2] != 0
121 && ip.uint8[2] != 255)/* 169.254.1.0 to 169.254.254.255 range. */
121 return 0; 122 return 0;
122 123
123 return -1; 124 return -1;
@@ -143,7 +144,7 @@ int send_LANdiscovery(uint16_t port, Net_Crypto *c)
143 uint8_t data[crypto_box_PUBLICKEYBYTES + 1]; 144 uint8_t data[crypto_box_PUBLICKEYBYTES + 1];
144 data[0] = NET_PACKET_LAN_DISCOVERY; 145 data[0] = NET_PACKET_LAN_DISCOVERY;
145 memcpy(data + 1, c->self_public_key, crypto_box_PUBLICKEYBYTES); 146 memcpy(data + 1, c->self_public_key, crypto_box_PUBLICKEYBYTES);
146 IP_Port ip_port = {broadcast_ip(), port}; 147 IP_Port ip_port = {.ip = broadcast_ip(), .port = port};
147 return sendpacket(c->lossless_udp->net->sock, ip_port, data, 1 + crypto_box_PUBLICKEYBYTES); 148 return sendpacket(c->lossless_udp->net->sock, ip_port, data, 1 + crypto_box_PUBLICKEYBYTES);
148} 149}
149 150