Skip to content

Commit 4f99d98

Browse files
authored
Update ethernetif.c
1 parent 9dc0bbb commit 4f99d98

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

components/net/lwip-2.1.2/src/netif/ethernetif.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ static int lwip_netdev_set_dns_server(struct netdev *netif, uint8_t dns_num, ip_
163163
static int lwip_netdev_set_dhcp(struct netdev *netif, rt_bool_t is_enabled)
164164
{
165165
netdev_low_level_set_dhcp_status(netif, is_enabled);
166+
167+
if(RT_TRUE == is_enabled)
168+
{
169+
dhcp_start((struct netif *)netif->user_data);
170+
}
171+
else
172+
{
173+
dhcp_stop((struct netif *)netif->user_data);
174+
}
175+
166176
return ERR_OK;
167177
}
168178
#endif /* RT_LWIP_DHCP */

0 commit comments

Comments
 (0)