Skip to content

Commit d616d90

Browse files
committed
Merge branch 'master' into ota_commands_in_flash
2 parents 3ebeb26 + a460cb7 commit d616d90

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cores/esp8266/IPAddress.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ IPAddress::IPAddress() {
3232
}
3333

3434
bool IPAddress::isSet () const {
35-
return !ip_addr_isany(&_ip);
35+
return !ip_addr_isany(&_ip) && ((*this) != IPADDR_NONE);
3636
}
3737

3838
IPAddress::IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet) {
@@ -183,6 +183,10 @@ bool IPAddress::isValid(const char* arg) {
183183
const IPAddress INADDR_ANY; // generic "0.0.0.0" for IPv4 & IPv6
184184
const IPAddress INADDR_NONE(255,255,255,255);
185185

186+
void IPAddress::clear() {
187+
(*this) = INADDR_ANY;
188+
}
189+
186190
/**************************************/
187191

188192
#if LWIP_IPV6

cores/esp8266/IPAddress.h

+2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ class IPAddress: public Printable {
125125
virtual size_t printTo(Print& p) const;
126126
String toString() const;
127127

128+
void clear();
129+
128130
/*
129131
check if input string(arg) is a valid IPV4 address or not.
130132
return true on valid.

0 commit comments

Comments
 (0)