dns_server: fix max ttl reply issue.
This commit is contained in:
@@ -39,17 +39,17 @@ TEST_F(DomainRule, bogus_nxdomain)
|
||||
if (request->qtype != DNS_T_A) {
|
||||
return smartdns::SERVER_REQUEST_SOA;
|
||||
}
|
||||
if (request->domain == "a.com") {
|
||||
smartdns::MockServer::AddIP(request, request->domain.c_str(), "10.11.12.13", 611);
|
||||
return smartdns::SERVER_REQUEST_OK;
|
||||
}
|
||||
if (request->domain == "a.com") {
|
||||
smartdns::MockServer::AddIP(request, request->domain.c_str(), "10.11.12.13", 611);
|
||||
return smartdns::SERVER_REQUEST_OK;
|
||||
}
|
||||
|
||||
smartdns::MockServer::AddIP(request, request->domain.c_str(), "1.2.3.4", 611);
|
||||
return smartdns::SERVER_REQUEST_OK;
|
||||
});
|
||||
|
||||
/* this ip will be discard, but is reachable */
|
||||
server.MockPing(PING_TYPE_ICMP, "1.2.3.4", 60, 10);
|
||||
/* this ip will be discard, but is reachable */
|
||||
server.MockPing(PING_TYPE_ICMP, "1.2.3.4", 60, 10);
|
||||
|
||||
server.Start(R"""(bind [::]:60053
|
||||
server udp://127.0.0.1:61053 -blacklist-ip
|
||||
@@ -64,7 +64,7 @@ cache-persist no)""");
|
||||
ASSERT_EQ(client.GetAuthorityNum(), 1);
|
||||
EXPECT_EQ(client.GetStatus(), "NXDOMAIN");
|
||||
|
||||
ASSERT_TRUE(client.Query("b.com", 60053));
|
||||
ASSERT_TRUE(client.Query("b.com", 60053));
|
||||
std::cout << client.GetResult() << std::endl;
|
||||
ASSERT_EQ(client.GetAnswerNum(), 1);
|
||||
EXPECT_EQ(client.GetStatus(), "NOERROR");
|
||||
|
||||
Reference in New Issue
Block a user