mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
Ensure the MQTT address is an IPv4 before determining it's private (#5081)
* Ensure the mqtt address is an IPv4 (or at least not a domain) before determining it's private. * check address length
This commit is contained in:
@@ -120,9 +120,9 @@ class MQTT : private concurrency::OSThread
|
||||
// returns true if this is a valid JSON envelope which we accept on downlink
|
||||
bool isValidJsonEnvelope(JSONObject &json);
|
||||
|
||||
/// Determines if the given IP address is a private address, i.e. not routable on the public internet.
|
||||
/// 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 ip[]);
|
||||
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; }
|
||||
|
||||
Reference in New Issue
Block a user