Normalize startup policy CIDRs - #187
Closed
fallintoplace wants to merge 1 commit into
Closed
Conversation
fallintoplace
force-pushed
the
fix/normalize-initial-policy-targets
branch
from
July 30, 2026 19:19
9b36a79 to
643f0cd
Compare
fallintoplace
force-pushed
the
fix/normalize-initial-policy-targets
branch
from
July 30, 2026 19:19
643f0cd to
fb55677
Compare
Contributor
|
Hello Minh 👋 Thanks for the contribution! We ended up landing a broader change in #188, which I believe already addresses this. I'm going to close this PR as superseded. |
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.
Proxy::newdecides whether to enable bridge isolation from the startup--allowtargets. Unlike policy updates received through the control socket, those targets were not normalized first.ipnetpreserves host bits when parsing a CIDR, so192.0.2.1/0and0.0.0.0/0are distinct values until truncated. The packet filter still treats both as the default route, but the exact isolation check only recognized0.0.0.0/0. As a result, an equivalent/0spelling allowed all destinations while unexpectedly leaving bridge isolation enabled.Canonicalize startup targets before configuring the host and building the packet-filter rules. Prefix normalization now lives on
Targetand is shared with control policy updates, while the control path keeps its existing sorting and deduplication behavior.Tests:
cargo test --no-runcargo clippy --all-targets -- -D warnings