diff options
Diffstat (limited to 'main/tollgate_main.c')
| -rw-r--r-- | main/tollgate_main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/main/tollgate_main.c b/main/tollgate_main.c index 30fad8d..9d2c392 100644 --- a/main/tollgate_main.c +++ b/main/tollgate_main.c | |||
| @@ -156,6 +156,12 @@ static void wifi_create_ap_netif(void) | |||
| 156 | ESP_ERROR_CHECK(esp_netif_set_ip_info(s_ap_netif, &ip_info)); | 156 | ESP_ERROR_CHECK(esp_netif_set_ip_info(s_ap_netif, &ip_info)); |
| 157 | ESP_ERROR_CHECK(esp_netif_dhcps_start(s_ap_netif)); | 157 | ESP_ERROR_CHECK(esp_netif_dhcps_start(s_ap_netif)); |
| 158 | 158 | ||
| 159 | esp_netif_dns_info_t dns_info; | ||
| 160 | dns_info.ip.u_addr.ip4.addr = ip_info.ip.addr; | ||
| 161 | dns_info.ip.type = IPADDR_TYPE_V4; | ||
| 162 | esp_netif_set_dns_info(s_ap_netif, ESP_NETIF_DNS_MAIN, &dns_info); | ||
| 163 | ESP_LOGI(TAG, "AP DNS server set to " IPSTR, IP2STR(&ip_info.ip)); | ||
| 164 | |||
| 159 | dhcps_offer_t offer_dns = true; | 165 | dhcps_offer_t offer_dns = true; |
| 160 | esp_netif_dhcps_option(s_ap_netif, ESP_NETIF_OP_SET, ESP_NETIF_DOMAIN_NAME_SERVER, | 166 | esp_netif_dhcps_option(s_ap_netif, ESP_NETIF_OP_SET, ESP_NETIF_DOMAIN_NAME_SERVER, |
| 161 | &offer_dns, sizeof(offer_dns)); | 167 | &offer_dns, sizeof(offer_dns)); |