Commit 0e2b2430 authored by Vitaly Lipatov's avatar Vitaly Lipatov

route-update: fix domain detection for IPv6 IP-only lists

[a-zA-Z] matches hex digits a-f in IPv6 addresses, causing IP-only lists like antifilter-ip6 (127k entries) to be treated as domain lists. This triggered useless history merge (sort -u on ~2.5M lines = 77 min) and DNS resolution attempts. Use [g-zG-Z] instead, which correctly distinguishes domain names from IPv6 hex notation. Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 775d24e5
......@@ -524,7 +524,7 @@ resolve_list_file()
vlog "$_tag$_label resolving..."
> "$_resolved_new.tmp"
if grep -v '^#' "$_f" | grep -q '[a-zA-Z]' ; then
if grep -v '^#' "$_f" | grep -q '[g-zG-Z]' ; then
cat_expanded "$_f" | grep -v '^#' | grep -v '^$' | $_resolve_func | \
grep -v '^#' | grep -v '^$' >> "$_resolved_new.tmp"
else
......@@ -553,7 +553,7 @@ resolve_list_file()
rm -f "$_resolved_new.tmp"
# Accumulate resolve history (DNS round-robin) — only for lists with domains
if grep -v '^#' "$_f" | grep -q '[a-zA-Z]' ; then
if grep -v '^#' "$_f" | grep -q '[g-zG-Z]' ; then
local history_dir="$STATE_DIR/$_state/resolve_history"
mkdir -p "$history_dir"
rm -f "$history_dir/$HISTORY_SIZE"
......@@ -571,7 +571,7 @@ resolve_list_file()
fi
# Detect volatile domains (IPv4 and IPv6)
if grep -v '^#' "$_f" | grep -q '[a-zA-Z]' ; then
if grep -v '^#' "$_f" | grep -q '[g-zG-Z]' ; then
local _vname=$(echo "$_tag" | tr -d '[]')
local _rtype="A"
[ "$_ipcmd" = "ip -6" ] && _rtype="AAAA"
......
Markdown is supported
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