From 207635632b79329926ca407063ed4ec70b26ded3 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Mon, 29 Feb 2016 15:07:45 +0100 Subject: [PATCH] marsadm: check uniqueness of IPs at join-cluster --- userspace/marsadm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/userspace/marsadm b/userspace/marsadm index 67ababce..6714887d 100755 --- a/userspace/marsadm +++ b/userspace/marsadm @@ -1584,6 +1584,11 @@ sub join_cluster { unless ($dry_run) { _run_rsync("rsync --recursive --links --max-size=1 -v $peer:$mars/ $mars/"); } + # check uniqness of IPs + foreach my $other_ip_path (glob("$mars/ips/*")) { + my $other_ip = get_link($other_ip_path, 1); + ldie "New IP '$ip' already exists at '$other_ip_path'\n" if $ip eq $other_ip; + } _create_cluster(@_); finish_links(); unless ($dry_run) {