We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1cb6b8 commit 16b1aebCopy full SHA for 16b1aeb
cores/esp32/IPAddress.cpp
@@ -266,7 +266,7 @@ IPAddress &IPAddress::operator=(const IPAddress &address) {
266
}
267
268
bool IPAddress::operator==(const IPAddress &addr) const {
269
- return (addr._type == _type) && (memcmp(addr._address.bytes, _address.bytes, sizeof(_address.bytes)) == 0);
+ return (addr._type == _type) && (_type == IPType::IPv4 ? addr._address.dword[IPADDRESS_V4_DWORD_INDEX] == _address.dword[IPADDRESS_V4_DWORD_INDEX] : memcmp(addr._address.bytes, _address.bytes, sizeof(_address.bytes)) == 0);
270
271
272
bool IPAddress::operator==(const uint8_t *addr) const {
@@ -395,6 +395,7 @@ IPAddress &IPAddress::from_ip_addr_t(const ip_addr_t *addr) {
395
#endif /* LWIP_IPV6_SCOPES */
396
} else {
397
_type = IPv4;
398
+ memset(_address.bytes, 0, sizeof(_address.bytes));
399
_address.dword[IPADDRESS_V4_DWORD_INDEX] = addr->u_addr.ip4.addr;
400
401
return *this;
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments