Skip to content

Commit

Permalink
add RFC 3927 IP address space to private IP checks (#5115)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rbrtio authored Oct 21, 2024
1 parent 5ff8c90 commit a4705d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mqtt/MQTT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a4705d2

Please sign in to comment.