Share the iptables jump rule spec between install and cleanup

This commit is contained in:
Viktor Liu
2026-06-10 17:44:33 +02:00
parent 1b6294f2ff
commit a5d4373ddc
6 changed files with 51 additions and 52 deletions
+1 -3
View File
@@ -157,9 +157,7 @@ func (r *family) addMSSClampingRules() error {
mss := r.mtu - overhead
// Add jump rule from FORWARD chain in mangle table to our custom chain
jumpRule := []string{
"-j", chainRTMSSClamp,
}
jumpRule := jumpRuleSpec(chainRTMSSClamp)
if err := r.iptablesClient.Insert(tableMangle, chainForward, 1, jumpRule...); err != nil {
return fmt.Errorf("add jump to MSS clamp chain: %w", err)
}