summaryrefslogtreecommitdiffstats
path: root/core/modules/iptables-helper
diff options
context:
space:
mode:
authorSimon Rettberg2018-03-14 15:28:51 +0100
committerSimon Rettberg2018-03-14 15:28:51 +0100
commita70ff93200b5f34712d4c83d0ccfb522a7d01d3e (patch)
treec7d8a407a9cfc55b5f16b4a7869fa4880f701955 /core/modules/iptables-helper
parent[pam-slx-plug] Change location of user's krb5 CC (diff)
downloadmltk-a70ff93200b5f34712d4c83d0ccfb522a7d01d3e.tar.gz
mltk-a70ff93200b5f34712d4c83d0ccfb522a7d01d3e.tar.xz
mltk-a70ff93200b5f34712d4c83d0ccfb522a7d01d3e.zip
[run-virt/iptables-helper] Handle race condition when adding interfaces
Diffstat (limited to 'core/modules/iptables-helper')
-rwxr-xr-xcore/modules/iptables-helper/data/opt/openslx/iptables/iptables-reloader2
-rwxr-xr-xcore/modules/iptables-helper/data/opt/openslx/iptables/iptables-reloader-worker5
2 files changed, 6 insertions, 1 deletions
diff --git a/core/modules/iptables-helper/data/opt/openslx/iptables/iptables-reloader b/core/modules/iptables-helper/data/opt/openslx/iptables/iptables-reloader
index 60ca1e2c..d29b7725 100755
--- a/core/modules/iptables-helper/data/opt/openslx/iptables/iptables-reloader
+++ b/core/modules/iptables-helper/data/opt/openslx/iptables/iptables-reloader
@@ -1,5 +1,7 @@
#!/bin/ash
+rm -f -- "/run/iptables-reloader.cache" "/run/iptables-reloader.lock"
+
/opt/openslx/iptables/iptables-reloader-worker
exec /opt/openslx/sbin/inotifyd /opt/openslx/iptables/iptables-reloader-worker /opt/openslx/iptables/rules.d:cndmy
diff --git a/core/modules/iptables-helper/data/opt/openslx/iptables/iptables-reloader-worker b/core/modules/iptables-helper/data/opt/openslx/iptables/iptables-reloader-worker
index 43e35eca..4ee3ac8a 100755
--- a/core/modules/iptables-helper/data/opt/openslx/iptables/iptables-reloader-worker
+++ b/core/modules/iptables-helper/data/opt/openslx/iptables/iptables-reloader-worker
@@ -29,7 +29,10 @@ reload_rules () {
done
# No change? Do nothing...
- [ -s "${ALL_RULES}" -a -s "${ALL_RULES}.new" ] && diff "${ALL_RULES}" "${ALL_RULES}.new" && exit 0
+ if [ -s "${ALL_RULES}" ] && [ -s "${ALL_RULES}.new" ] && diff "${ALL_RULES}" "${ALL_RULES}.new"; then
+ rm -f -- "${ALL_RULES}.new"
+ exit 0
+ fi
# Reset
# Filter