From 4f99d988d9713e5ebbf35564d55a7b30938c9563 Mon Sep 17 00:00:00 2001 From: David Lin Date: Sat, 21 Nov 2020 12:35:19 +0800 Subject: [PATCH] Update ethernetif.c --- components/net/lwip-2.1.2/src/netif/ethernetif.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/net/lwip-2.1.2/src/netif/ethernetif.c b/components/net/lwip-2.1.2/src/netif/ethernetif.c index 10865930c1..52bd0fb7b6 100644 --- a/components/net/lwip-2.1.2/src/netif/ethernetif.c +++ b/components/net/lwip-2.1.2/src/netif/ethernetif.c @@ -163,6 +163,16 @@ static int lwip_netdev_set_dns_server(struct netdev *netif, uint8_t dns_num, ip_ static int lwip_netdev_set_dhcp(struct netdev *netif, rt_bool_t is_enabled) { netdev_low_level_set_dhcp_status(netif, is_enabled); + + if(RT_TRUE == is_enabled) + { + dhcp_start((struct netif *)netif->user_data); + } + else + { + dhcp_stop((struct netif *)netif->user_data); + } + return ERR_OK; } #endif /* RT_LWIP_DHCP */