summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Müller <muellerd@fb.com>2022-02-02 17:18:05 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-05 17:46:05 +0000
commit2b3ae4d1abdd4b800098625e52ac6e501c2063f4 (patch)
tree70a5b677907d07929da055052ab5f821f7ea01bb
parent254fbcf614cd57d5a5d4ca36b9765b463eaaf10f (diff)
downloadpoky-2b3ae4d1abdd4b800098625e52ac6e501c2063f4.tar.gz
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. (From OE-Core rev: 0ebcfb034bcad81efef5f746f0aa0b69772901a0) Signed-off-by: Daniel Müller <muellerd@fb.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/runqemu-ifdown1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/runqemu-ifdown b/scripts/runqemu-ifdown
index a104c37bf8..e0eb5344c6 100755
--- a/scripts/runqemu-ifdown
+++ b/scripts/runqemu-ifdown
@@ -64,3 +64,4 @@ n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]
64dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ] 64dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ]
65$IPTABLES -D POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$n/32 65$IPTABLES -D POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$n/32
66$IPTABLES -D POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$dest/32 66$IPTABLES -D POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$dest/32
67true