fix: nftables interval end overflow EEXIST for max-address ranges - #4319
Closed
H-TTTTT wants to merge 1 commit into
Closed
fix: nftables interval end overflow EEXIST for max-address ranges#4319H-TTTTT wants to merge 1 commit into
H-TTTTT wants to merge 1 commit into
Conversation
route_exclude_address ranges that reach 255.255.255.255 / ffff:...:ffff made nftablesCreateIPSet encode a duplicate interval start/end key. Point sing-tun at the fix that omits the exclusive end when Next() overflows (H-TTTTT/sing-tun@8775818, SagerNet/sing-tun#83). Fixes SagerNet#4316
nekohasekai
force-pushed
the
testing
branch
12 times, most recently
from
July 22, 2026 02:36
3b9cd24 to
3fcfadd
Compare
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
auto_redirect+route_exclude_addressCIDRs whose upper bound is the address-family max (ff00::/8,240.0.0.0/4, …) failed setup with nftables EEXIST (file exists).sing-tunnftablesCreateIPSet: whenTo().Next()overflows, the end key was set equal to the start key.github.com/sagernet/sing-tunwith the fix from fix: omit nftables interval end when range hits max address sing-tun#83 (H-TTTTT/sing-tun@8775818), which omits the exclusive interval-end element so the range covers through the max address.Note for maintainers: drop the
replaceand bump to an officialsing-tuntag/commit once SagerNet/sing-tun#83 is merged.Test plan
route_exclude_address: ["ff00::/8"]withauto_redirect: truestarts cleanly240.0.0.0/4/224.0.0.0/3also workFixes #4316