summaryrefslogtreecommitdiff
path: root/core/LAN_discovery.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-08-19 23:54:28 -0400
committerirungentoo <irungentoo@gmail.com>2013-08-19 23:54:28 -0400
commitafa6edecc1739b635162e742cd5c95c2db8127bd (patch)
tree9421d638578ac8b752e5c5ec71957a2896da1be9 /core/LAN_discovery.c
parentb16906d5e42cf65e198de0ccd21155df4a364c56 (diff)
Some refactoring done.
Diffstat (limited to 'core/LAN_discovery.c')
-rw-r--r--core/LAN_discovery.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/LAN_discovery.c b/core/LAN_discovery.c
index ad1337ef..3045e215 100644
--- a/core/LAN_discovery.c
+++ b/core/LAN_discovery.c
@@ -121,7 +121,7 @@ static int LAN_ip(IP ip)
121 return -1; 121 return -1;
122} 122}
123 123
124static int handle_LANdiscovery(IP_Port source, uint8_t *packet, uint32_t length) 124static int handle_LANdiscovery(void * object, IP_Port source, uint8_t *packet, uint32_t length)
125{ 125{
126 if (LAN_ip(source.ip) == -1) 126 if (LAN_ip(source.ip) == -1)
127 return 1; 127 return 1;
@@ -140,11 +140,11 @@ int send_LANdiscovery(uint16_t port)
140 data[0] = 33; 140 data[0] = 33;
141 memcpy(data + 1, self_public_key, crypto_box_PUBLICKEYBYTES); 141 memcpy(data + 1, self_public_key, crypto_box_PUBLICKEYBYTES);
142 IP_Port ip_port = {broadcast_ip(), port}; 142 IP_Port ip_port = {broadcast_ip(), port};
143 return sendpacket(ip_port, data, 1 + crypto_box_PUBLICKEYBYTES); 143 return sendpacket(temp_net->sock, ip_port, data, 1 + crypto_box_PUBLICKEYBYTES);
144} 144}
145 145
146 146
147void LANdiscovery_init(void) 147void LANdiscovery_init(void)
148{ 148{
149 networking_registerhandler(33, &handle_LANdiscovery); 149 networking_registerhandler(temp_net, 33, &handle_LANdiscovery, NULL);
150} 150}