Merge branch 'main' into peer-acl-multi-source

# Conflicts:
#	client/firewall/nftables/router_linux.go
#	client/firewall/uspfilter/filter.go
This commit is contained in:
Viktor Liu
2026-07-31 22:07:04 +02:00
484 changed files with 34762 additions and 8263 deletions
+12 -7
View File
@@ -297,6 +297,17 @@ func (r *family) addMSSClampingRules() error {
return r.conn.Flush()
}
func buildLegacyRouteRuleExpressions(sourceExp, destExp []expr.Any) []expr.Any {
exprs := make([]expr.Any, 0, len(sourceExp)+len(destExp)+2)
exprs = append(exprs, sourceExp...)
exprs = append(exprs, destExp...)
exprs = append(exprs,
&expr.Counter{},
&expr.Verdict{Kind: expr.VerdictAccept},
)
return exprs
}
func (r *family) addLegacyRouteRule(pair firewall.RouterPair) error {
sourceExp, err := r.applyNetwork(pair.Source, nil, true)
if err != nil {
@@ -309,13 +320,7 @@ func (r *family) addLegacyRouteRule(pair firewall.RouterPair) error {
return fmt.Errorf("apply destination: %w", err)
}
var exprs []expr.Any
exprs = append(exprs, sourceExp...)
exprs = append(exprs, destExp...)
exprs = append(exprs,
&expr.Counter{},
&expr.Verdict{Kind: expr.VerdictAccept},
)
exprs := buildLegacyRouteRuleExpressions(sourceExp, destExp)
ruleID := pair.GenKey(firewall.ForwardingFormat)