From a4705d2c190b8d6ae4a7059e08b894ff1fc6f4e8 Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 21 Oct 2024 03:25:27 -0500 Subject: [PATCH] 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. --- src/mqtt/MQTT.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 3ad397beb..2a2018395 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -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; }