Comment 11 for bug 1791958

Revision history for this message
Andreas Hasenack (ahasenack) wrote : Re: iptables-restore is missing -w option

Thanks for the b3 version!

It restores the bionic implicit lock behavior (as if -w was given), but when given a specific value, in the end it ignores that it couldn't acquire the lock and moves on:

In all these tests, I have a lock held.

We have a chain called "andreas". See how -L waits 1 second as I requested, but moves on, listing the chain:
root@b1-iptables-restore-wait-lock:~# time iptables -L andreas -w 1
Chain andreas (0 references)
target prot opt source destination

real 0m1.005s
user 0m0.004s
sys 0m0.000s

Now I delete the chain. This shouldn't work because another app is holding the lock:
root@b1-iptables-restore-wait-lock:~# time iptables -X andreas -w 1

real 0m1.006s
user 0m0.005s
sys 0m0.000s

Was it deleted? Let's list again, and it was:
root@b1-iptables-restore-wait-lock:~# time iptables -L andreas -w 1
iptables: No chain/target/match by that name.

real 0m1.005s
user 0m0.004s
sys 0m0.000s

root@b1-iptables-restore-wait-lock:~# apt-cache policy iptables
iptables:
  Installed: 1.6.1-2ubuntu2+testpkg20210629b3
  Candidate: 1.6.1-2ubuntu2+testpkg20210629b3
  Version table:
 *** 1.6.1-2ubuntu2+testpkg20210629b3 500
        500 http://ppa.launchpad.net/slashd/lp1791958/ubuntu bionic/main amd64 Packages