Sync with SagerNet/sing-box upstream (sagernet/testing) - #34
Open
hiddifydeveloper wants to merge 91 commits into
Open
Sync with SagerNet/sing-box upstream (sagernet/testing)#34hiddifydeveloper wants to merge 91 commits into
hiddifydeveloper wants to merge 91 commits into
Conversation
Since b0c6762, every rule inside a referenced rule-set was evaluated as if merged into the outer rule, which required tracking per-branch group states and let outer rules and rule-set rules satisfy each other's grouped conditions in both directions. Restrict merging to the only designed case: a rule-set containing exactly one non-inverted default rule is merged into the outer rule as before. Any other rule-set now matches as an ordinary condition of the outer rule: it matches when any of its rules matches on its own, and its rules no longer exchange grouped match state with the outer rule in either direction. Multiple referenced rule-sets keep OR semantics. Flat address rule-sets such as generated geosite/geoip sets contain a single default rule, so their behavior is unchanged. The group-state set machinery is replaced by a single required/satisfied mask pair. Also update the route and DNS rule docs.
DHCP option 119/15 and resolved link domains are not rooted, so appending them to the query name produced a non-FQDN name, failing to pack with "domain must be fully qualified".
Merges ~89 upstream commits since the last sync point (1dc8872), bringing in: JSON schema support, new DNS rule "evaluate" action, flow-dispatcher-based tun.Port/DirectRoute API, USBIP/OpenVPN/ OpenConnect protocols, WARP/MASQUE improvements, and various fixes. Conflict resolution kept all hiddify-specific (//H-tagged) additions alongside upstream's changes. Notable follow-ups needed beyond textual conflicts: - adapter.DNSTransport/DNSClient gained ExchangeAsync; added sync-to- async wrappers to hiddify's multi/sdns DNS transports and test fakes. - option.DialerOptions/DNSRouteActionOptions restructured fields under Abstract*Options embeds; fixed call sites in transport/awg, protocol/wireguard, and test literals. - protocol/group/balancer's sticky session used a freelru API (NewSharded) not present in the pinned sagernet/sing version; ported to the unified freelru.New(..., sharded=true) constructor. - Added filippo.io/age dependency and ported the "age support for report export" commit to experimental/libbox/log.go (auto-merge had dropped it since it landed after this fork's last sync). - transport/wireguard/endpoint.go's UDP egress-pool feature (StdNetBind.SetEgressProvider/SetSinglePeerMode) is disabled: hiddify's wireguard-go fork (replace/wireguard-go) has not been rebased onto SagerNet/wireguard-go@6f5e8b1 ("Add EgressProvider") yet. Left a TODO; needs that fork updated separately. - option/v2ray_transport.go's new DescribeSchema doesn't list a UnionVariant for XHTTP transport (hiddify-specific), even though the marshal/unmarshal code handles it — schema generation may need a follow-up. Verified: go build ./... and go vet ./... clean (same 4 pre-existing build-tagged test packages fail as on pre-sync baseline: common/geosite, common/tlsspoof, dns/transport/local, protocol/masque — unrelated). dns package tests pass. TestTrustTunnelSelf and TestTrustTunnelQUICSelf (-tags with_quic) both pass.
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
sagernet/testingsince the last sync point (1dc887264).tun.Port/DirectRouteAPI, USBIP/OpenVPN/OpenConnect protocols, WARP/MASQUE improvements, and various upstream fixes.//H-tagged) additions preserved throughout conflict resolution.Notable follow-ups beyond textual conflicts
adapter.DNSTransport/DNSClientgainedExchangeAsync; added sync-to-async wrappers to hiddify'smulti/sdnsDNS transports and test fakes.option.DialerOptions/DNSRouteActionOptionsrestructured fields underAbstract*Optionsembeds; fixed call sites intransport/awg,protocol/wireguard, and test literals.protocol/group/balancer's sticky session used afreelruAPI (NewSharded) not present in the pinnedsagernet/singversion; ported to the unifiedfreelru.New(..., sharded=true)constructor.filippo.io/agedependency and ported the "age support for report export" commit toexperimental/libbox/log.go(auto-merge had silently dropped it since it landed after this fork's last sync point).transport/wireguard/endpoint.go's UDP egress-pool feature is disabled: hiddify'swireguard-gofork (replace/wireguard-go) has not been rebased ontosagernet/wireguard-go@6f5e8b1("Add EgressProvider") yet. Left aTODOcomment; needs that fork updated separately as a follow-up.option/v2ray_transport.go's newDescribeSchemadoesn't list aUnionVariantfor XHTTP transport (hiddify-specific), even though marshal/unmarshal code handles it — schema generation may need a follow-up.Test plan
go build ./...— cleango vet ./...— identical to pre-sync baseline (same 4 pre-existing build-tagged test-only failures:common/geosite,common/tlsspoof,dns/transport/local,protocol/masque— all unrelated, confirmed present before this sync too)go test ./dns/...— passgo test ./...— pass except the same 4 baseline packages + Docker-dependent integration tests (no Docker daemon in this environment)go test -tags with_quic -run TestTrustTunnel ./...(intest/) —TestTrustTunnelSelfandTestTrustTunnelQUICSelfboth PASS