Use IPAddress.fromString for parsing private IPs (#5621)

This commit is contained in:
Eric Severance
2024-12-20 16:21:27 -08:00
committed by GitHub
parent 960626e498
commit 58d80b8557
2 changed files with 33 additions and 74 deletions

View File

@@ -121,10 +121,6 @@ class MQTT : private concurrency::OSThread
// Check if we should report unencrypted information about our node for consumption by a map
void perhapsReportToMap();
/// Determines if the given address is a private IPv4 address, i.e. not routable on the public internet.
/// These are the ranges: 127.0.0.1, 10.0.0.0-10.255.255.255, 172.16.0.0-172.31.255.255, 192.168.0.0-192.168.255.255.
bool isPrivateIpAddress(const char address[]);
/// Return 0 if sleep is okay, veto sleep if we are connected to pubsub server
// int preflightSleepCb(void *unused = NULL) { return pubSub.connected() ? 1 : 0; }
};