upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/main/dns_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/dns_server.c')
-rw-r--r--main/dns_server.c3
1 files changed, 1 insertions, 2 deletions
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
85 85
86static int build_nxdomain(uint8_t *response, int req_len) 86static int build_nxdomain(uint8_t *response, int req_len)
87{ 87{
88 memcpy(response, response, req_len);
89 dns_header_t *hdr = (dns_header_t *)response; 88 dns_header_t *hdr = (dns_header_t *)response;
90 hdr->flags = htons(0x8403); 89 hdr->flags = htons(0x8403);
91 hdr->ancount = 0; 90 hdr->ancount = 0;
@@ -96,7 +95,7 @@ static int build_nxdomain(uint8_t *response, int req_len)
96 95
97static int build_redirect_response(uint8_t *response, int req_len) 96static int build_redirect_response(uint8_t *response, int req_len)
98{ 97{
99 memcpy(response, response, req_len); 98 memmove(response, response, req_len);
100 dns_header_t *hdr = (dns_header_t *)response; 99 dns_header_t *hdr = (dns_header_t *)response;
101 hdr->flags = htons(0x8180); 100 hdr->flags = htons(0x8180);
102 hdr->ancount = htons(1); 101 hdr->ancount = htons(1);