Update code
This commit is contained in:
@@ -416,7 +416,7 @@ static int _dns_client_process(struct dns_query_struct *dns_query, unsigned long
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tlog(TLOG_INFO, "recv from %s", gethost_by_addr(from_host, (struct sockaddr *)&from, from_len));
|
tlog(TLOG_DEBUG, "recv from %s", gethost_by_addr(from_host, (struct sockaddr *)&from, from_len));
|
||||||
|
|
||||||
if (_dns_client_recv(inpacket, len, &from, from_len) != 0) {
|
if (_dns_client_recv(inpacket, len, &from, from_len) != 0) {
|
||||||
int fd = open("dns.bin", O_CREAT | O_TRUNC | O_RDWR);
|
int fd = open("dns.bin", O_CREAT | O_TRUNC | O_RDWR);
|
||||||
|
|||||||
10
dns_server.c
10
dns_server.c
@@ -426,6 +426,10 @@ static int _dns_client_process_answer(struct dns_request *request, char *domain,
|
|||||||
unsigned char addr[4];
|
unsigned char addr[4];
|
||||||
_dns_server_request_get(request);
|
_dns_server_request_get(request);
|
||||||
dns_get_A(rrs, name, DNS_MAX_CNAME_LEN, &ttl, addr);
|
dns_get_A(rrs, name, DNS_MAX_CNAME_LEN, &ttl, addr);
|
||||||
|
if (request->has_ipv4 == 0) {
|
||||||
|
memcpy(request->ipv4_addr, addr, DNS_RR_A_LEN);
|
||||||
|
request->has_ipv4 = 1;
|
||||||
|
}
|
||||||
if (_dns_ip_address_check_add(request, addr, DNS_T_A) != 0) {
|
if (_dns_ip_address_check_add(request, addr, DNS_T_A) != 0) {
|
||||||
_dns_server_request_release(request);
|
_dns_server_request_release(request);
|
||||||
break;
|
break;
|
||||||
@@ -443,6 +447,12 @@ static int _dns_client_process_answer(struct dns_request *request, char *domain,
|
|||||||
unsigned char addr[16];
|
unsigned char addr[16];
|
||||||
_dns_server_request_get(request);
|
_dns_server_request_get(request);
|
||||||
dns_get_AAAA(rrs, name, DNS_MAX_CNAME_LEN, &ttl, addr);
|
dns_get_AAAA(rrs, name, DNS_MAX_CNAME_LEN, &ttl, addr);
|
||||||
|
|
||||||
|
if (request->has_ipv6 == 0) {
|
||||||
|
memcpy(request->ipv6_addr, addr, DNS_RR_AAAA_LEN);
|
||||||
|
request->has_ipv6 = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (_dns_ip_address_check_add(request, addr, DNS_T_AAAA) != 0) {
|
if (_dns_ip_address_check_add(request, addr, DNS_T_AAAA) != 0) {
|
||||||
_dns_server_request_release(request);
|
_dns_server_request_release(request);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
|
||||||
#ifndef _PERF_BITOPS_H
|
#ifndef _PERF_BITOPS_H
|
||||||
#define _PERF_BITOPS_H
|
#define _PERF_BITOPS_H
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
|
||||||
#ifndef _GENERIC_BITOPS_H_
|
#ifndef _GENERIC_BITOPS_H_
|
||||||
#define _GENERIC_BITOPS_H_
|
#define _GENERIC_BITOPS_H_
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user