1
0
mirror of https://github.com/MetaCubeX/mihomo.git synced 2026-10-10 20:23:11 +08:00

chore: code cleanup

This commit is contained in:
wwqgtxx
2026-06-22 10:09:19 +08:00
parent 8c40e36087
commit 76bf840121
2 changed files with 10 additions and 11 deletions
+9 -8
View File
@@ -338,18 +338,19 @@ dns:
# 配置 fallback 使用条件
# fallback-filter:
# geoip: true # 配置是否使用 geoip
# geoip-code: CN # 当 nameserver 域名的 IP 查询 geoip 库为 CN 时,不使用 fallback 中的 DNS 查询结果
# 配置强制 fallback,优先于 IP 判断,具体分类自行查看 geosite 库
# geosite:
# - gfw
# 如果不匹配 ipcidr 则使用 nameservers 中的结果
# ipcidr:
# geoip: true # 配置是否使用 geoip
# geoip-code: CN # 当 nameserver 解析出域名的 IP 查询 geoip 库为 CN 时, 使用 nameserver 中的 DNS 查询结果
# ipcidr: # 当 nameserver 解析出域名的 IP 匹配 ipcidr 时,使用 fallback 中的 DNS 查询结果
# - 240.0.0.0/4
# domain:
# - 0.0.0.0/32
# - 127.0.0.1/32
# - 100.64.0.0/10
# domain: # 匹配到这些域名,会直接使用 fallback 解析,不去使用 nameserver
# - '+.google.com'
# - '+.facebook.com'
# - '+.youtube.com'
# geosite: # 匹配到这些域名,会直接使用 fallback 解析,不去使用 nameserver(已废弃,请使用 nameserver-policy)
# - gfw
# fallback-lazy-query: false # 默认值为 false ,如果为 true 会先判断来自 nameserver 的结果是否满足 fallback-filter 后再发起查询
# 配置查询域名使用的 DNS 服务器
+1 -3
View File
@@ -9,7 +9,6 @@ import (
"github.com/metacubex/mihomo/component/geodata"
"github.com/metacubex/mihomo/component/geodata/router"
"github.com/metacubex/mihomo/component/mmdb"
"github.com/metacubex/mihomo/component/resolver"
C "github.com/metacubex/mihomo/constant"
"github.com/metacubex/mihomo/log"
@@ -157,8 +156,7 @@ func (g *GEOIP) isLan(ip netip.Addr) bool {
ip.IsUnspecified() ||
ip.IsLoopback() ||
ip.IsMulticast() ||
ip.IsLinkLocalUnicast() ||
resolver.IsFakeBroadcastIP(ip)
ip.IsLinkLocalUnicast()
}
func (g *GEOIP) Adapter() string {