浏览代码

[net][lwip] fix lwIP 2.1.0 personalized sign bug

liuxinaliang 5 年之前
父节点
当前提交
83b290c289
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      components/net/lwip-2.1.0/src/netif/ethernetif.c

+ 6 - 1
components/net/lwip-2.1.0/src/netif/ethernetif.c

@@ -487,8 +487,13 @@ static err_t eth_netif_device_init(struct netif *netif)
 rt_err_t eth_device_init_with_flag(struct eth_device *dev, const char *name, rt_uint16_t flags)
 {
     struct netif* netif;
-
+#if LWIP_NETIF_HOSTNAME
+#define LWIP_HOSTNAME_LEN 16
+    char *hostname = RT_NULL;
+    netif = (struct netif*) rt_malloc (sizeof(struct netif) + LWIP_HOSTNAME_LEN);
+#else
     netif = (struct netif*) rt_malloc (sizeof(struct netif));
+#endif
     if (netif == RT_NULL)
     {
         rt_kprintf("malloc netif failed\n");