File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -201,7 +201,13 @@ bool IPAddress::fromString6(const char *address) {
201
201
colons++;
202
202
acc = 0 ;
203
203
} else if (c == ' %' ) {
204
- _zone = netif_name_to_index (address);
204
+ // netif_index_to_name crashes on latest esp-idf
205
+ // _zone = netif_name_to_index(address);
206
+ // in the interim, we parse the suffix as a zone number
207
+ while ((*address != ' \0 ' ) && (!isdigit (*address))) { // skip all non-digit after '%'
208
+ address++;
209
+ }
210
+ _zone = atol (address);
205
211
while (*address != ' \0 ' ) {
206
212
address++;
207
213
}
@@ -351,6 +357,11 @@ size_t IPAddress::printTo(Print &p, bool includeZone) const {
351
357
// netif_index_to_name(_zone, if_name);
352
358
// n += p.print(if_name);
353
359
// }
360
+ // In the interim, we just output the index number
361
+ if (_zone > 0 && includeZone) {
362
+ n += p.print (' %' );
363
+ n += p.print (_zone);
364
+ }
354
365
return n;
355
366
}
356
367
You can’t perform that action at this time.
0 commit comments