]> code.ossystems Code Review - openembedded-core.git/commit
scripts/runqemu-ifdown: Don't treat the last iptables command as special
authorDaniel Müller <muellerd@fb.com>
Wed, 2 Feb 2022 17:18:05 +0000 (17:18 +0000)
committerAnuj Mittal <anuj.mittal@intel.com>
Tue, 15 Feb 2022 04:34:57 +0000 (12:34 +0800)
commita94191274ae84dae7facc8d161f34270a42b304b
tree2c5278fb968644cf14b8f47932b9ef37b52b8ba6
parent5e5874d9b8f954771edb4ee3725bb31c1c5a70f2
scripts/runqemu-ifdown: Don't treat the last iptables command as special

The runqemu-ifup script performs a bunch of setup steps that
runqemu-ifdown attempts to undo later on. While a bunch of said setup
operations are considered fatal should they fail, the iptables based NAT
setup notably is not.
The tear down procedure in runqemu-ifdown, however, has the iptables
based tear down as the last operation, with the status of it determining
the overall status of the script. Hence, if this step fails, the script
is considered a failure overall. That is arguably inconsistent: If the
NAT setup did not succeed, the tear down cannot succeed either.
To ensure similarity of the two paths, let's not treat the last iptables
tear down operation any special and allow it to fail the runqemu-ifdown
script, but just ignore failures.

Background: we have seen a NAT related setup problem on the ifup path
(which didn't cause script failure), but then saw an issue bubbled up
when this operation was meant to be undone on the ifdown path.

Signed-off-by: Daniel Müller <muellerd@fb.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 0ebcfb034bcad81efef5f746f0aa0b69772901a0)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
scripts/runqemu-ifdown