diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-02-08 15:18:54 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-02-08 15:47:36 +0000 |
commit | 0eeb16d03118b25a9605d9626ee2b578116fb9b7 (patch) | |
tree | 5c5d8380c93bcb27f184ddfe11a391cb42cbaa08 /toxcore/LAN_discovery.c | |
parent | 8a0e98bab8a4bccd11adc0e2c838910ed1b6d794 (diff) |
Reject discovery packets coming from outside the LAN.
Even if that means rejecting packets from ourselves if our IP is not a
"LAN" IP.
Diffstat (limited to 'toxcore/LAN_discovery.c')
-rw-r--r-- | toxcore/LAN_discovery.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c index cb10b0aa..2f43ea11 100644 --- a/toxcore/LAN_discovery.c +++ b/toxcore/LAN_discovery.c | |||
@@ -351,16 +351,10 @@ static int handle_LANdiscovery(void *object, IP_Port source, const uint8_t *pack | |||
351 | char ip_str[IP_NTOA_LEN] = { 0 }; | 351 | char ip_str[IP_NTOA_LEN] = { 0 }; |
352 | ip_ntoa(&source.ip, ip_str, sizeof(ip_str)); | 352 | ip_ntoa(&source.ip, ip_str, sizeof(ip_str)); |
353 | 353 | ||
354 | // TODO(iphydf): Add logging for this case. | ||
355 | // Why should we reject discovery packets from outside the LAN? | ||
356 | #if 0 | ||
357 | |||
358 | if (ip_is_lan(source.ip) == -1) { | 354 | if (ip_is_lan(source.ip) == -1) { |
359 | return 1; | 355 | return 1; |
360 | } | 356 | } |
361 | 357 | ||
362 | #endif | ||
363 | |||
364 | if (length != CRYPTO_PUBLIC_KEY_SIZE + 1) { | 358 | if (length != CRYPTO_PUBLIC_KEY_SIZE + 1) { |
365 | return 1; | 359 | return 1; |
366 | } | 360 | } |