fix(banip): prevent unnecessary blocklist mtime updates#1709
Closed
gsanchietti wants to merge 1 commit into
Closed
fix(banip): prevent unnecessary blocklist mtime updates#1709gsanchietti wants to merge 1 commit into
gsanchietti wants to merge 1 commit into
Conversation
Wrap the blocklist file write in the IPv4 and IPv6 deduplicate paths with a cmp -s check. This prevents unnecessary file mtime updates when deduplication removes no entries. Since banip.blocklist is a conffile included in sysupgrade backups, the unconditional writes caused the backup tar to differ every night even when actual configuration was unchanged. With this fix, the file is only written when content actually changes, preserving mtime and preventing spurious backup differences. Closes #1146
Member
Author
|
While the fix seems to work, it does not really resolve the issue of the backup that always changes MD5 because other files are regenerated on every backup. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix issue where banip's deduplication process unconditionally rewrites the blocklist file every night, causing system backups to change even when configuration is unchanged.
Root cause
The banip package (with
ban_deduplicate=1default) runs nightly and filters the blocklist against a deduplication index. However, it unconditionally writes the result back to/etc/banip/banip.blocklist, updating the file's mtime even when the content is identical. Sincesysupgrade -k -bincludes file mtimes in backup tars, this causes non-deterministic backup generation.Changes
packages/banip/files/banip-functions.sh:cmp -scheck before writing the deduped blocklist (IPv4 path, line 955-958)cmp -scheck before writing the deduped blocklist (IPv6 path, line 971-975)packages/banip/MakefilePKG_RELEASE from 3 to 4Testing
Related issue
#1146