Skip to content

Commit

Permalink
Make IPAddress's operator!= compare values, not memory addresses. (es…
Browse files Browse the repository at this point in the history
…phome#5537)

Co-authored-by: Ben Winslow <[email protected]>
  • Loading branch information
raineth and raineth authored Oct 16, 2023
1 parent 06eff72 commit 26f12cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion esphome/components/network/ip_address.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct IPAddress {
bool is_ip6() { return IP_IS_V6(&ip_addr_); }
std::string str() const { return ipaddr_ntoa(&ip_addr_); }
bool operator==(const IPAddress &other) const { return ip_addr_cmp(&ip_addr_, &other.ip_addr_); }
bool operator!=(const IPAddress &other) const { return !(&ip_addr_ == &other.ip_addr_); }
bool operator!=(const IPAddress &other) const { return !ip_addr_cmp(&ip_addr_, &other.ip_addr_); }
IPAddress &operator+=(uint8_t increase) {
if (IP_IS_V4(&ip_addr_)) {
#if LWIP_IPV6
Expand Down

0 comments on commit 26f12cd

Please sign in to comment.