From a7d0a672d59bf8985a6fc0e61b49015fabd96513 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 15 May 2026 17:03:40 +0530 Subject: Phase 1 working: captive portal, DNS hijack, NAT-based access control - Fix WiFi init order: netif creation before esp_wifi_init, set mode before set_config - Replace broken netif input filter with NAPT on/off per authentication state - NAPT disabled by default, enabled when client granted, disabled on revoke - Fix test helpers: use -I wlp59s0 for ping, handle nslookup exit code 1 - All 20 API tests pass, all 6 smoke tests pass --- main/dns_server.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'main/dns_server.c') diff --git a/main/dns_server.c b/main/dns_server.c index f7977c6..733e771 100644 --- a/main/dns_server.c +++ b/main/dns_server.c @@ -85,7 +85,6 @@ static void parse_dns_name(const uint8_t *buf, int buf_len, int offset, char *ou static int build_nxdomain(uint8_t *response, int req_len) { - memcpy(response, response, req_len); dns_header_t *hdr = (dns_header_t *)response; hdr->flags = htons(0x8403); hdr->ancount = 0; @@ -96,7 +95,7 @@ static int build_nxdomain(uint8_t *response, int req_len) static int build_redirect_response(uint8_t *response, int req_len) { - memcpy(response, response, req_len); + memmove(response, response, req_len); dns_header_t *hdr = (dns_header_t *)response; hdr->flags = htons(0x8180); hdr->ancount = htons(1); -- cgit v1.2.3