diff --git a/user/config_flash.c b/user/config_flash.c index 0af7b51..f5f56ce 100644 --- a/user/config_flash.c +++ b/user/config_flash.c @@ -32,7 +32,6 @@ config_load_default(sysconfig_p config) config->client_watchdog = -1; IP4_ADDR(&config->network_addr, 192, 168, 4, 1); - config->dns_addr.addr = 0; // use DHCP config->my_addr.addr = 0; // use DHCP config->my_netmask.addr = 0; // use DHCP config->my_gw.addr = 0; // use DHCP diff --git a/user/config_flash.h b/user/config_flash.h index 7e31b55..e06068c 100644 --- a/user/config_flash.h +++ b/user/config_flash.h @@ -44,7 +44,6 @@ typedef struct int32_t client_watchdog; ip_addr_t network_addr; // Address of the internal network - ip_addr_t dns_addr; // Optional: address of the dns server ip_addr_t my_addr; // Optional (if not DHCP): IP address of the uplink side ip_addr_t my_netmask; // Optional (if not DHCP): IP netmask of the uplink side diff --git a/user/user_main.c b/user/user_main.c index ac563ce..0b5c9db 100644 --- a/user/user_main.c +++ b/user/user_main.c @@ -6,7 +6,6 @@ #include "os_type.h" #include "lwip/ip.h" #include "lwip/netif.h" -#include "lwip/dns.h" #include "lwip/lwip_napt.h" #include "lwip/app/dhcpserver.h" #include "lwip/app/espconn.h" @@ -46,7 +45,6 @@ sysconfig_t config; static ringbuf_t console_rx_buffer, console_tx_buffer; static ip_addr_t my_ip; -static ip_addr_t dns_ip; bool connected; uint8_t my_channel; bool do_ip_config; @@ -305,7 +303,7 @@ console_handle_command(struct espconn *pespconn) os_sprintf(response, "show [config|stats]\r\n"); to_console(response); - os_sprintf(response, "set [ssid|password|auto_connect|ap_ssid] \r\nset [sta_mac|sta_hostname] \r\nset [dns|ip|netmask|gw] \r\n"); + os_sprintf(response, "set [ssid|password|auto_connect|ap_ssid] \r\nset [sta_mac|sta_hostname] \r\nset [ip|netmask|gw] \r\n"); to_console(response); os_sprintf(response, "set [speed|status_led|config_port] \r\nsave [config|dhcp]\r\nconnect | disconnect| reset [factory] | quit\r\n"); to_console(response); @@ -369,12 +367,6 @@ console_handle_command(struct espconn *pespconn) IP2STR(&config.network_addr)); to_console(response); - // if static DNS, add it - os_sprintf(response, - config.dns_addr.addr?" DNS: %d.%d.%d.%d\r\n":"\r\n", - IP2STR(&config.dns_addr)); - to_console(response); - // if static IP, add it os_sprintf(response, config.my_addr.addr?"Static IP: %d.%d.%d.%d Netmask: %d.%d.%d.%d Gateway: %d.%d.%d.%d\r\n":"", @@ -757,27 +749,6 @@ console_handle_command(struct espconn *pespconn) goto command_handled; } - if (strcmp(tokens[1], "dns") == 0) - { - if (os_strcmp(tokens[2], "dhcp") == 0) - { - config.dns_addr.addr = 0; - os_sprintf(response, "DNS from DHCP\r\n"); - } - else - { - config.dns_addr.addr = ipaddr_addr(tokens[2]); - os_sprintf(response, "DNS set to %d.%d.%d.%d\r\n", - IP2STR(&config.dns_addr)); - if (config.dns_addr.addr) - { - dns_ip.addr = config.dns_addr.addr; - dhcps_set_DNS(&dns_ip); - } - } - goto command_handled; - } - if (strcmp(tokens[1], "ip") == 0) { if (os_strcmp(tokens[2], "dhcp") == 0) @@ -1041,17 +1012,10 @@ wifi_handle_event_cb(System_Event_t *evt) case EVENT_STAMODE_GOT_IP: { - if (config.dns_addr.addr == 0) - { - dns_ip = dns_getserver(0); - } - dhcps_set_DNS(&dns_ip); - - os_printf("ip:" IPSTR ",mask:" IPSTR ",gw:" IPSTR ",dns:" IPSTR "\n", + os_printf("ip:" IPSTR ",mask:" IPSTR ",gw:" IPSTR "\n", IP2STR(&evt->event_info.got_ip.ip), IP2STR(&evt->event_info.got_ip.mask), - IP2STR(&evt->event_info.got_ip.gw), - IP2STR(&dns_ip)); + IP2STR(&evt->event_info.got_ip.gw)); my_ip = evt->event_info.got_ip.ip; connected = true; @@ -1145,9 +1109,6 @@ user_set_softap_ip_config(void) wifi_softap_dhcps_start(); - // Change the DNS server again - dhcps_set_DNS(&dns_ip); - // Enter any saved dhcp enties if they are in this network for (i = 0; i