Merge pull request #3618 from longtengmcu/master

fix three bugs about ethernet
This commit is contained in:
Bernard Xiong
2020-06-01 15:32:53 +08:00
committed by GitHub
3 changed files with 30 additions and 1 deletions
@@ -164,6 +164,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);
/*add dhcp start or stop must call dhcp_start and dhcp_stop function*/
if(is_enabled == RT_TRUE)
{
dhcp_start((struct netif *)netif->user_data);
}
else
{
dhcp_stop((struct netif *)netif->user_data);
}
return ERR_OK;
}
#endif /* RT_LWIP_DHCP */
@@ -564,6 +564,9 @@ int sal_accept(int socket, struct sockaddr *addr, socklen_t *addrlen)
/* get the socket object by socket descriptor */
SAL_SOCKET_OBJ_GET(sock, socket);
/* check the network interface is up status */
SAL_NETDEV_IS_UP(sock->netdev);
/* check the network interface socket operations */
SAL_NETDEV_SOCKETOPS_VALID(sock->netdev, pf, accept);