[client] Ensure dst-type local marks can overwrite nat marks (#3738)

This commit is contained in:
Viktor Liu
2025-04-25 12:43:20 +02:00
committed by GitHub
parent 2817f62c13
commit ef8b8a2891
2 changed files with 6 additions and 2 deletions

View File

@@ -666,7 +666,9 @@ func (r *router) addNatRule(pair firewall.RouterPair) error {
}
}
r.rules[ruleKey] = r.conn.AddRule(&nftables.Rule{
// Ensure nat rules come first, so the mark can be overwritten.
// Currently overwritten by the dst-type LOCAL rules for redirected traffic.
r.rules[ruleKey] = r.conn.InsertRule(&nftables.Rule{
Table: r.workTable,
Chain: r.chains[chainNameManglePrerouting],
Exprs: exprs,