Gitweb:
http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=8bbfa3a95f0...
Commit: 8bbfa3a95f00ebe738c3b07ae58a0f1e15d61014
Parent: 23bae572bfed8abde2f03b878505e511ae92a43a
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Fri Nov 20 15:51:46 2015 +0000
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Nov 20 15:51:46 2015 +0000
cman: Improve node name matching
Be more intelligent about matching node names. Instead of just
looking at the short name and the FQDN, we now look at increasingly
more specific names until we match or fail.
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
cman/daemon/cman-preconfig.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index 99ee80d..ce29e4a 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -468,16 +468,19 @@ static int verify_nodename(struct objdb_iface_ver0 *objdb, char
*node)
if (nodelist_byname(objdb, cluster_parent_handle, node))
return 0;
- /* If nodename was from uname, try a domain-less version of it */
+ /* If nodename was from uname, try to match with increasingly more
+ * specific versions of it
+ */
strcpy(nodename2, node);
- dot = strchr(nodename2, '.');
- if (dot) {
+ dot = strrchr(nodename2, '.');
+ while (dot) {
*dot = '\0';
if (nodelist_byname(objdb, cluster_parent_handle, nodename2)) {
strcpy(node, nodename2);
return 0;
}
+ dot = strrchr(nodename2, '.');
}
/* If nodename (from uname) is domain-less, try to match against