From 6f36ebc06ce757077ca011970abfc645a13dc0fe Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Fri, 5 Apr 2024 19:32:38 +0300 Subject: [PATCH] Pull request 2189: 5345-ipset-file-comments Updates #5345. Squashed commit of the following: commit 66ceac9ac2646bd9a8d6be545b283008342f3153 Merge: 8be4dce3c 82247d764 Author: Stanislav Chzhen Date: Fri Apr 5 19:05:48 2024 +0300 Merge branch 'master' into 5345-ipset-file-comments commit 8be4dce3ca7420464084ce062aac81de9ddb53c8 Author: Stanislav Chzhen Date: Tue Apr 2 14:56:21 2024 +0300 all: upd chlog commit 53c72130157b4bb8c55208f2faee24a80456b85f Author: Stanislav Chzhen Date: Tue Apr 2 14:48:56 2024 +0300 dnsforward: ipset file comments --- CHANGELOG.md | 6 ++++++ internal/dnsforward/config.go | 1 + 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4adc38e8..dd068218 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,12 @@ See also the [v0.107.49 GitHub milestone][ms-v0.107.49]. NOTE: Add new changes BELOW THIS COMMENT. --> +### Added + +- Support for comments in the ipset file ([#5345]). + +[#5345]: https://github.com/AdguardTeam/AdGuardHome/issues/5345 + diff --git a/internal/dnsforward/config.go b/internal/dnsforward/config.go index db2d50af..78f4acb6 100644 --- a/internal/dnsforward/config.go +++ b/internal/dnsforward/config.go @@ -452,6 +452,7 @@ func (s *Server) prepareIpsetListSettings() (err error) { } ipsets := stringutil.SplitTrimmed(string(data), "\n") + ipsets = stringutil.FilterOut(ipsets, IsCommentOrEmpty) log.Debug("dns: using %d ipset rules from file %q", len(ipsets), fn)