Skip to content

Commit 4c07113

Browse files
authored
lwIP: v2.1.3 + dhcp fixes (#8319)
* lwIP: v2.1.3 * interface set as default when gw is valid
1 parent a05a71f commit 4c07113

21 files changed

+109
-31
lines changed

cores/esp8266/LwipIntfDev.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class LwipIntfDev: public LwipIntf, public RawDev
6666

6767
void setDefault();
6868

69+
// true if interface has a valid IPv4 address
6970
bool connected()
7071
{
7172
return !!ip4_addr_get_u32(ip_2_ip4(&_netif.ip_addr));
@@ -305,8 +306,10 @@ void LwipIntfDev<RawDev>::netif_status_callback()
305306
{
306307
if (connected())
307308
{
308-
if (_default)
309+
if (_default || (netif_default == nullptr && !ip_addr_isany(&_netif.gw)))
309310
{
311+
// on user request,
312+
// or if there is no current default interface, but a gateway is valid
310313
netif_set_default(&_netif);
311314
}
312315
sntp_stop();

tools/sdk/lib/liblwip2-1460-feat.a

6.88 KB
Binary file not shown.

tools/sdk/lib/liblwip2-1460.a

6 KB
Binary file not shown.

tools/sdk/lib/liblwip2-536-feat.a

6.88 KB
Binary file not shown.

tools/sdk/lib/liblwip2-536.a

6.01 KB
Binary file not shown.

tools/sdk/lib/liblwip6-1460-feat.a

11.9 KB
Binary file not shown.

tools/sdk/lib/liblwip6-536-feat.a

11.9 KB
Binary file not shown.

tools/sdk/lwip2/include/glue.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,20 @@ err_glue_t glue2esp_linkoutput (int netif_idx, void* ref2save, void* data, size
118118
#define lwip_xt_rsil(level) (__extension__({uint32_t state; __asm__ __volatile__("rsil %0," __STRINGIFY(level) : "=a" (state) :: "memory"); state;}))
119119
#define lwip_xt_wsr_ps(state) __asm__ __volatile__("wsr %0,ps; isync" :: "a" (state) : "memory")
120120

121+
// quickfix: workaround for definition of __PRI32(x) in inttypes.h
122+
// it has changed with recent version of xtensa-gcc
123+
// __INT32 is missing
124+
// gcc-4.x: __PRI32(x) is __STRINGIFY(l##x)
125+
// gcc-10.2.0: __PRI32(x) is __INT32 __STRINGIFY(x)
126+
#include <inttypes.h>
127+
#if !defined(__INT8)
128+
#define __INT8
129+
#endif
130+
#if !defined(__INT16)
131+
#define __INT16
132+
#endif
133+
#if !defined(__INT32)
134+
#define __INT32 "l"
135+
#endif
136+
121137
#endif // GLUE_H
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// generated by makefiles/make-lwip2-hash
22
#ifndef LWIP_HASH_H
33
#define LWIP_HASH_H
4-
#define LWIP_HASH_STR "STABLE-2_1_2_RELEASE/glue:1.2-48-g7421258"
4+
#define LWIP_HASH_STR "STABLE-2_1_3_RELEASE/glue:1.2-58-g450bb63"
55
#endif // LWIP_HASH_H

0 commit comments

Comments
 (0)