luci: fix the bug that may be triggered

This commit is contained in:
xiaorouji 2023-09-13 21:42:19 +08:00 committed by sbwml
parent e99c858b85
commit 9ce7d88ee2
2 changed files with 5 additions and 2 deletions

View File

@ -1233,14 +1233,16 @@ function gen_config(var)
end
local direct_rule = {
server = dns_tag,
domain = domain,
domain = #domain > 0 and domain or nil,
domain_suffix = #domain_suffix > 0 and domain_suffix or nil,
domain_keyword = #domain_keyword > 0 and domain_keyword or nil,
domain_regex = #domain_regex > 0 and domain_regex or nil,
geosite = #geosite > 0 and geosite or nil,
disable_cache = false,
}
table.insert(dns.rules, direct_rule)
if direct_rule.domain or direct_rule.domain_suffix or direct_rule.domain_keyword or direct_rule.domain_regex or direct_rule.geosite then
table.insert(dns.rules, direct_rule)
end
local direct_strategy = "prefer_ipv6"
if direct_dns_query_strategy == "UseIPv4" then

View File

@ -1036,6 +1036,7 @@ function gen_config(var)
address = remote_dns_server,
port = (_remote_dns_proto ~= "doh" and tonumber(remote_dns_port)) and tonumber(remote_dns_port) or 53,
network = "tcp",
nonIPQuery = (_remote_dns_proto == "tcp") and "skip" or "drop"
}
})