From a5fddaecc3ccd03a0e79579a24fe8248f0706c71 Mon Sep 17 00:00:00 2001 From: David Lin Date: Wed, 10 Jun 2020 11:08:01 +0800 Subject: [PATCH] Update ethernetif.c --- components/net/lwip-1.4.1/src/netif/ethernetif.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/net/lwip-1.4.1/src/netif/ethernetif.c b/components/net/lwip-1.4.1/src/netif/ethernetif.c index 75f86d75d8..85ac09524b 100644 --- a/components/net/lwip-1.4.1/src/netif/ethernetif.c +++ b/components/net/lwip-1.4.1/src/netif/ethernetif.c @@ -452,7 +452,11 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, const char *name, rt_ rt_kprintf("malloc netif failed\n"); return -RT_ERROR; } +#if LWIP_NETIF_HOSTNAME + rt_memset(netif, 0, sizeof(struct netif) + LWIP_HOSTNAME_LEN); +#else rt_memset(netif, 0, sizeof(struct netif)); +#endif /* set netif */ dev->netif = netif;