Skip to content

Commit

Permalink
only call ipset restore if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
blotus committed Jul 16, 2024
1 parent 36eaae4 commit 390bde9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/iptables/iptables_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ func (ctx *ipTablesContext) commit() error {
}
}

if len(ctx.toAdd) == 0 && len(ctx.toDel) == 0 {
return nil
}

return ctx.defaultSet.Restore(tmpFile.Name())
}

Expand Down

0 comments on commit 390bde9

Please sign in to comment.