Skip to content

Commit c08864b

Browse files
Merge pull request #4444 from Archcady/lwip_issue
resolve lwip init twice issue
2 parents 77b6127 + b1ca77b commit c08864b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

features/FEATURE_LWIP/lwip-interface/lwip_stack.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,13 @@ nsapi_error_t mbed_lwip_emac_init(emac_interface_t *emac)
476476
// Backwards compatibility with people using DEVICE_EMAC
477477
nsapi_error_t mbed_lwip_init(emac_interface_t *emac)
478478
{
479+
nsapi_error_t ret;
479480
mbed_lwip_core_init();
480-
return mbed_lwip_emac_init(emac);
481+
ret = mbed_lwip_emac_init(emac);
482+
if (ret == NSAPI_ERROR_OK) {
483+
netif_inited = true;
484+
}
485+
return ret;
481486
}
482487

483488
// Backwards compatibility with people using DEVICE_EMAC

0 commit comments

Comments
 (0)