Skip to content

Commit 4f53c68

Browse files
authored
Update ethernetif.c
1 parent a5fddae commit 4f53c68

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,11 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, const char *name, rt_
499499
rt_kprintf("malloc netif failed\n");
500500
return -RT_ERROR;
501501
}
502+
#if LWIP_NETIF_HOSTNAME
503+
rt_memset(netif, 0, sizeof(struct netif) + LWIP_HOSTNAME_LEN);
504+
#else
502505
rt_memset(netif, 0, sizeof(struct netif));
506+
#endif
503507

504508
/* set netif */
505509
dev->netif = netif;

0 commit comments

Comments
 (0)