add RFC 3927 IP address space to private IP checks (#5115)

Add the RFC 3927 IP address block (169.254.0.0/16), also referred to as IPIPA, to the private address checks for MQTT functionality.
This commit is contained in:
Robert
2024-10-21 03:25:27 -05:00
committed by GitHub
parent 5ff8c904c8
commit a4705d2c19

View File

@@ -746,7 +746,8 @@ bool MQTT::isPrivateIpAddress(const char address[])
}
// Check the easy ones first.
if (strcmp(address, "127.0.0.1") == 0 || strncmp(address, "10.", 3) == 0 || strncmp(address, "192.168", 7) == 0) {
if (strcmp(address, "127.0.0.1") == 0 || strncmp(address, "10.", 3) == 0 || strncmp(address, "192.168", 7) == 0 ||
strncmp(address, "169.254", 7) == 0) {
return true;
}