summaryrefslogtreecommitdiff
path: root/ctdb/config
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-11-21 14:39:43 +1100
committerMartin Schwenke <martins@samba.org>2014-12-05 21:02:40 +0100
commitc314ae0b2af4a902cdd003ec6d663fe5b62b003b (patch)
treeeead9c791875713339ea52ec7e59e175b1658788 /ctdb/config
parented029ae0a1faa56bf882a71d10828e2a90ab0bc7 (diff)
downloadsamba-c314ae0b2af4a902cdd003ec6d663fe5b62b003b.tar.gz
ctdb-scripts: New functions ip6tables() and iptables_wrapper()
ip6tables() uses the same lock as iptables(). This is done on suspicion. iptables_wrapper() takes 1st argument "inet" or "inet6", and the rest is passed to the correct iptables variant. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/config')
-rwxr-xr-xctdb/config/functions15
1 files changed, 14 insertions, 1 deletions
diff --git a/ctdb/config/functions b/ctdb/config/functions
index eb98ce8a170..9d91e6a61ad 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -1356,10 +1356,23 @@ ctdb_standard_event_handler ()
}
# iptables doesn't like being re-entered, so flock-wrap it.
-iptables()
+iptables ()
{
flock -w 30 $CTDB_VARDIR/iptables-ctdb.flock /sbin/iptables "$@"
}
+ip6tables ()
+{
+ flock -w 30 $CTDB_VARDIR/iptables-ctdb.flock /sbin/ip6tables "$@"
+}
+iptables_wrapper ()
+{
+ _family="$1" ; shift
+ if [ "$_family" = "inet6" ] ; then
+ ip6tables "$@"
+ else
+ iptables "$@"
+ fi
+}
# AIX (and perhaps others?) doesn't have mktemp
if ! which mktemp >/dev/null 2>&1 ; then