Commit 1bf8a41f authored by Vitaly Lipatov's avatar Vitaly Lipatov

Deduplicate IPs when merging multiple groups in export

When requesting group=gre,egw,zapret the same IP can appear in multiple lists. _flatten() now uses a set to remove duplicates while preserving order. Co-Authored-By: 's avatarClaude Opus 4.6 (1M context) <noreply@anthropic.com>
parent 793bf128
......@@ -1526,9 +1526,13 @@ class RouteHandler(http.server.BaseHTTPRequestHandler):
return
def _flatten(col):
seen = set()
out = []
for ips in col.values():
out.extend(ips)
for ip in ips:
if ip not in seen:
seen.add(ip)
out.append(ip)
return out
if fmt == "mikrotik" and proto == "all":
......
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