Skip to content

Commit 73f4930

Browse files
committed
bug fix
1 parent 2044be5 commit 73f4930

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

package/openwrt/files/etc/init.d/smartdns

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ set_forward_dnsmasq()
5454
uci_batch="$uci_batch set dhcp.@dnsmasq[0].noresolv=1\n"
5555
uci_batch="$uci_batch set dhcp.@dnsmasq[0].rebind_protection=0\n"
5656
uci_batch="$uci_batch set dhcp.@dnsmasq[0].domainneeded=0\n"
57-
echo -e "$uci_batch" | uci batch -
57+
echo -e "$uci_batch" | uci batch -q -
5858
uci commit dhcp
5959
/etc/init.d/dnsmasq reload
6060
}
@@ -74,7 +74,7 @@ stop_forward_dnsmasq()
7474
uci_batch="$uci_batch delete dhcp.@dnsmasq[0].noresolv\n"
7575
uci_batch="$uci_batch set dhcp.@dnsmasq[0].rebind_protection=1\n"
7676
uci_batch="$uci_batch set dhcp.@dnsmasq[0].domainneeded=1\n"
77-
echo -e "$uci_batch" | uci batch -
77+
echo -e "$uci_batch" | uci batch -q -
7878
uci commit dhcp
7979
[ "$norestart" != "1" ] && /etc/init.d/dnsmasq reload
8080
}
@@ -105,7 +105,7 @@ set_main_dns()
105105
return
106106
fi
107107

108-
echo -e "$uci_batch" | uci batch -
108+
echo -e "$uci_batch" | uci batch -q -
109109
uci commit dhcp
110110
/etc/init.d/dnsmasq reload
111111
}
@@ -125,7 +125,7 @@ stop_main_dns()
125125
}
126126
uci_batch="$uci_batch delete dhcp.@dnsmasq[0].port\n"
127127
uci_batch="$uci_batch del_list dhcp.lan.dhcp_option=\"6,$hostip\"\n"
128-
echo -e "$uci_batch" | uci batch -
128+
echo -e "$uci_batch" | uci batch -q -
129129
uci commit dhcp
130130
[ "$norestart" != "1" ] && /etc/init.d/dnsmasq reload
131131
}
@@ -819,7 +819,7 @@ load_service()
819819
uci_batch="$uci_batch set smartdns.@smartdns[0].old_port=\"$port\"\n"
820820
uci_batch="$uci_batch set smartdns.@smartdns[0].old_enabled=\"$enabled\"\n"
821821
uci_batch="$uci_batch set smartdns.@smartdns[0].old_auto_set_dnsmasq=\"$auto_set_dnsmasq\"\n"
822-
echo -e "$uci_batch" | uci batch -
822+
echo -e "$uci_batch" | uci batch -q -
823823
uci commit smartdns
824824

825825
# disable service

src/dns_server/cache.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ static int _dns_cache_is_specify_packet(int qtype)
4242
case DNS_T_HTTPS:
4343
case DNS_T_TXT:
4444
case DNS_T_SRV:
45+
case DNS_T_CAA:
4546
break;
4647
default:
4748
return -1;

src/dns_server/request.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static int _dns_server_request_complete_with_all_IPs(struct dns_request *request
4747
int ttl = 0;
4848
struct dns_server_post_context context;
4949

50-
if (request->rcode == DNS_RC_SERVFAIL || request->rcode == DNS_RC_NXDOMAIN) {
50+
if (request->rcode == DNS_RC_SERVFAIL) {
5151
ttl = DNS_SERVER_FAIL_TTL;
5252
}
5353

src/include/smartdns/dns.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ typedef enum dns_type {
7878
DNS_T_HTTPS = 65,
7979
DNS_T_SPF = 99,
8080
DNS_T_AXFR = 252,
81-
DNS_T_ALL = 255
81+
DNS_T_CAA = 257,
82+
DNS_T_ALL = 65535,
8283
} dns_type_t;
8384

8485
typedef enum dns_opt_code {

test/cases/test-speed-check.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ TEST_F(SpeedCheck, tcp_faster_than_ping)
224224
return smartdns::SERVER_REQUEST_SOA;
225225
});
226226

227-
server.MockPing(PING_TYPE_ICMP, "1.2.3.4", 60, 350);
227+
server.MockPing(PING_TYPE_ICMP, "1.2.3.4", 60, 500);
228228
server.MockPing(PING_TYPE_TCP, "5.6.7.8:80", 60, 10);
229229
server.Start(R"""(bind [::]:60053
230230
server 127.0.0.1:61053

0 commit comments

Comments
 (0)