summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--util/linuxfw/nftables_runner.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/linuxfw/nftables_runner.go b/util/linuxfw/nftables_runner.go
index bc1eecd9c..feeae7477 100644
--- a/util/linuxfw/nftables_runner.go
+++ b/util/linuxfw/nftables_runner.go
@@ -860,7 +860,12 @@ func (n *nftablesRunner) createDummyPostroutingChains() (retErr error) {
}
// deleteChainIfExists deletes a chain if it exists.
+//
+// If table is nil, it returns nil.
func deleteChainIfExists(c *nftables.Conn, table *nftables.Table, name string) error {
+ if table == nil {
+ return nil
+ }
chain, err := getChainFromTable(c, table, name)
if err != nil && !errors.Is(err, errorChainNotFound{table.Name, name}) {
return fmt.Errorf("get chain: %w", err)