Skip to content

Commit a5fddae

Browse files
authored
Update ethernetif.c
1 parent 5f6c3d7 commit a5fddae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

components/net/lwip-1.4.1/src/netif/ethernetif.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,11 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, const char *name, rt_
452452
rt_kprintf("malloc netif failed\n");
453453
return -RT_ERROR;
454454
}
455+
#if LWIP_NETIF_HOSTNAME
456+
rt_memset(netif, 0, sizeof(struct netif) + LWIP_HOSTNAME_LEN);
457+
#else
455458
rt_memset(netif, 0, sizeof(struct netif));
459+
#endif
456460

457461
/* set netif */
458462
dev->netif = netif;

0 commit comments

Comments
 (0)