mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-18 12:44:30 +08:00
Update ethernetif.c
if LWIP_NETIF_HOSTNAME enable, the length is 'sizeof(struct netif)+ LWIP_HOSTNAME_LEN', not only equal to 'sizeof(struct netif)'.
This commit is contained in:
parent
ce83371504
commit
5f6c3d7345
@ -503,7 +503,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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user