Reject discovery packets coming from outside the LAN.

Even if that means rejecting packets from ourselves if our IP is not a
"LAN" IP.
This commit is contained in:
iphydf 2018-02-08 15:18:54 +00:00
parent 8a0e98bab8
commit 0eeb16d031
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9

View File

@ -351,16 +351,10 @@ static int handle_LANdiscovery(void *object, IP_Port source, const uint8_t *pack
char ip_str[IP_NTOA_LEN] = { 0 };
ip_ntoa(&source.ip, ip_str, sizeof(ip_str));
// TODO(iphydf): Add logging for this case.
// Why should we reject discovery packets from outside the LAN?
#if 0
if (ip_is_lan(source.ip) == -1) {
return 1;
}
#endif
if (length != CRYPTO_PUBLIC_KEY_SIZE + 1) {
return 1;
}