Merge pull request #2596 from Lawlieta/develop
[net][lwip] fix lwip netdev DNS address setup error
This commit is contained in:
commit
a641540936
|
@ -279,11 +279,14 @@ dns_setserver(u8_t numdns, ip_addr_t *dnsserver)
|
|||
dns_servers[numdns] = (*dnsserver);
|
||||
|
||||
#ifdef RT_USING_NETDEV
|
||||
extern struct netdev *netdev_default;
|
||||
extern struct netif *netif_default;
|
||||
extern struct netdev *netdev_get_by_name(const char *name);
|
||||
extern void netdev_low_level_set_dns_server(struct netdev *netdev, uint8_t dns_num, const ip_addr_t *dns_server);
|
||||
|
||||
/* set network interface device DNS server address */
|
||||
netdev_low_level_set_dns_server(netdev_default, numdns, dnsserver);
|
||||
if (netif_default) {
|
||||
netdev_low_level_set_dns_server(netdev_get_by_name(netif_default->name), numdns, dnsserver);
|
||||
}
|
||||
#endif /* RT_USING_NETDEV */
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,6 +99,7 @@ static char eth_rx_thread_stack[RT_LWIP_ETHTHREAD_STACKSIZE];
|
|||
|
||||
#ifdef RT_USING_NETDEV
|
||||
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/init.h"
|
||||
#include "lwip/netdb.h"
|
||||
#include <netdev.h>
|
||||
|
|
|
@ -370,11 +370,14 @@ dns_setserver(u8_t numdns, const ip_addr_t *dnsserver)
|
|||
dns_servers[numdns] = (*dnsserver);
|
||||
|
||||
#ifdef RT_USING_NETDEV
|
||||
extern struct netdev *netdev_default;
|
||||
extern struct netif *netif_default;
|
||||
extern struct netdev *netdev_get_by_name(const char *name);
|
||||
extern void netdev_low_level_set_dns_server(struct netdev *netdev, uint8_t dns_num, const ip_addr_t *dns_server);
|
||||
|
||||
/* set network interface device DNS server address */
|
||||
netdev_low_level_set_dns_server(netdev_default, numdns, dnsserver);
|
||||
if (netif_default) {
|
||||
netdev_low_level_set_dns_server(netdev_get_by_name(netif_default->name), numdns, dnsserver);
|
||||
}
|
||||
#endif /* RT_USING_NETDEV */
|
||||
} else {
|
||||
dns_servers[numdns] = *IP_ADDR_ANY;
|
||||
|
|
|
@ -107,6 +107,7 @@ static char eth_rx_thread_stack[RT_LWIP_ETHTHREAD_STACKSIZE];
|
|||
|
||||
#ifdef RT_USING_NETDEV
|
||||
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/init.h"
|
||||
#include "lwip/netdb.h"
|
||||
#include <netdev.h>
|
||||
|
|
|
@ -367,11 +367,14 @@ dns_setserver(u8_t numdns, const ip_addr_t *dnsserver)
|
|||
dns_servers[numdns] = (*dnsserver);
|
||||
|
||||
#ifdef RT_USING_NETDEV
|
||||
extern struct netdev *netdev_default;
|
||||
extern struct netif *netif_default;
|
||||
extern struct netdev *netdev_get_by_name(const char *name);
|
||||
extern void netdev_low_level_set_dns_server(struct netdev *netdev, uint8_t dns_num, const ip_addr_t *dns_server);
|
||||
|
||||
/* set network interface device DNS server address */
|
||||
netdev_low_level_set_dns_server(netdev_default, numdns, dnsserver);
|
||||
if (netif_default) {
|
||||
netdev_low_level_set_dns_server(netdev_get_by_name(netif_default->name), numdns, dnsserver);
|
||||
}
|
||||
#endif /* RT_USING_NETDEV */
|
||||
} else {
|
||||
dns_servers[numdns] = *IP_ADDR_ANY;
|
||||
|
|
|
@ -108,6 +108,7 @@ static char eth_rx_thread_stack[RT_LWIP_ETHTHREAD_STACKSIZE];
|
|||
|
||||
#ifdef RT_USING_NETDEV
|
||||
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/init.h"
|
||||
#include "lwip/netdb.h"
|
||||
#include <netdev.h>
|
||||
|
|
Loading…
Reference in New Issue