Commit 83b022ab authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Use "1" as shortcut for "::1" as well

parent 06837793
......@@ -948,7 +948,10 @@ class DnsVpnService : VpnService(), Runnable {
val resolveResult = dao.findRuleTarget(uniformQuestion, question.type, useUserRules)?.let {
when (it) {
"0" -> "0.0.0.0"
"1" -> "127.0.0.1"
"1" -> {
if (question.type == Record.TYPE.AAAA) "::1"
else "127.0.0.1"
}
else -> it
}
}
......
......@@ -272,14 +272,14 @@ class RuleImportService : Service() {
when {
matcher.groupCount() == 1 -> {
val host = matcher.group(1).replace(wwwRegex, "")
return DnsRule(Record.TYPE.ANY, host, "0", "::1", importedFrom = sourceId)
return DnsRule(Record.TYPE.ANY, host, "0", "1", importedFrom = sourceId)
}
matcher == DNSMASQ_MATCHER -> {
val host = matcher.group(1).replace(wwwRegex, "")
val target = matcher.group(2).let {
when (it) {
"0.0.0.0" -> "0"
"127.0.0.1" -> "1"
"127.0.0.1", "::1" -> "1"
else -> it
}
}
......@@ -290,7 +290,7 @@ class RuleImportService : Service() {
val host = matcher.group(2).replace(wwwRegex, "").let {
when (it) {
"0.0.0.0" -> "0"
"127.0.0.1" -> "1"
"127.0.0.1", "::1" -> "1"
else -> it
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment