diff options
| author | David Lin <[email protected]> | 2020-06-10 10:59:50 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-06-10 10:59:50 +0800 |
| commit | 5f6c3d73452f9f71e5a81939a2650760fb7b9aee (patch) | |
| tree | 92bb8035e983c1a3bfb136499cdaabbf6e071c60 /components | |
| parent | ce833715042dfae615f3bc5ca22b8d294b7cade0 (diff) | |
Update ethernetif.c
if LWIP_NETIF_HOSTNAME enable, the length is 'sizeof(struct netif)+ LWIP_HOSTNAME_LEN',
not only equal to 'sizeof(struct netif)'.
Diffstat (limited to 'components')
| -rw-r--r-- | components/net/lwip-2.0.2/src/netif/ethernetif.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/net/lwip-2.0.2/src/netif/ethernetif.c b/components/net/lwip-2.0.2/src/netif/ethernetif.c index be16da7ad3..8d69897a4b 100644 --- a/components/net/lwip-2.0.2/src/netif/ethernetif.c +++ b/components/net/lwip-2.0.2/src/netif/ethernetif.c @@ -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; |
