소스 검색

Update ethernetif.c

David Lin 5 년 전
부모
커밋
4f53c68b3b
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      components/net/lwip-2.1.0/src/netif/ethernetif.c

+ 4 - 0
components/net/lwip-2.1.0/src/netif/ethernetif.c

@@ -499,7 +499,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;