mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
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:
parent
8a0e98bab8
commit
0eeb16d031
|
@ -351,16 +351,10 @@ static int handle_LANdiscovery(void *object, IP_Port source, const uint8_t *pack
|
||||||
char ip_str[IP_NTOA_LEN] = { 0 };
|
char ip_str[IP_NTOA_LEN] = { 0 };
|
||||||
ip_ntoa(&source.ip, ip_str, sizeof(ip_str));
|
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) {
|
if (ip_is_lan(source.ip) == -1) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (length != CRYPTO_PUBLIC_KEY_SIZE + 1) {
|
if (length != CRYPTO_PUBLIC_KEY_SIZE + 1) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user