Skip to contentSkip to conversation

cluster/cman/daemon cmanccs.c

Cluster-devel [email protected] 1 participant 1 message Mar 15, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: pcaulfield at sourceware.org 2007-03-15 09:27:20

Modified files:
cman/daemon : cmanccs.c

Log message:

	Support IP(v4) addresses in cluster.conf
	per bz#232068

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cmanccs.c.diff?cvsroot=cluster&r1=1.24&r2=1.25

cman/daemon/cmanccs.c +17 -1
@@ -244,7 +244,6 @@
 	return 0;
 }
 
-
 static int verify_nodename(int cd, char *nodename)
 {
 	char path[MAX_PATH_LEN];
@@ -342,6 +341,23 @@
 			goto out;
 		}
 
+		/* See if it's the IP address that's in cluster.conf */
+		error = getnameinfo(sa, sizeof(*sa), nodename2,
+				    sizeof(nodename2), NULL, 0, NI_NUMERICHOST);
+		if (error)
+			goto out;
+
+		str = NULL;
+		memset(path, 0, 256);
+		sprintf(path, NODE_NAME_PATH_BYNAME, nodename2);
+
+		error = ccs_get(cd, path, &str);
+		if (!error) {
+			free(str);
+			strcpy(nodename, nodename2);
+			goto out;
+		}
+
 		/* truncate this name and try again */
 
 		dot = strstr(nodename2, ".");