cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: pcaulfield@sourceware.org <pcaulfield@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/cman/daemon cmanccs.c
Date: 15 Mar 2007 11:12:34 -0000	[thread overview]
Message-ID: <20070315111234.26788.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-03-15 11:12:33

Modified files:
	cman/daemon    : cmanccs.c 

Log message:
	If the machine is multi-homed, then using a truncated name in uname but not in
	cluster.conf would fail to match them up.

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

--- cluster/cman/daemon/cmanccs.c	2007/03/15 09:27:20	1.25
+++ cluster/cman/daemon/cmanccs.c	2007/03/15 11:12:33	1.26
@@ -313,14 +313,17 @@
 		free(str);
 	}
 
-
 	/* The cluster.conf names may not be related to uname at all,
-	   they may match a hostname on some network interface */
+	   they may match a hostname on some network interface.
+	   NOTE: This is IPv4 only */
 	error = getifaddrs(&ifa_list);
 	if (error)
 		return -1;
 
 	for (ifa = ifa_list; ifa; ifa = ifa->ifa_next) {
+
+		/* Restore this */
+		strcpy(nodename2, nodename);
 		sa = ifa->ifa_addr;
 		if (!sa || sa->sa_family != AF_INET)
 			continue;
@@ -341,11 +344,12 @@
 			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;
+		/* truncate this name and try again */
+
+		dot = strstr(nodename2, ".");
+		if (!dot)
+			continue;
+		*dot = '\0';
 
 		str = NULL;
 		memset(path, 0, 256);
@@ -358,12 +362,11 @@
 			goto out;
 		}
 
-		/* truncate this name and try again */
-
-		dot = strstr(nodename2, ".");
-		if (!dot)
-			continue;
-		*dot = '\0';
+		/* 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);



             reply	other threads:[~2007-03-15 11:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-15 11:12 pcaulfield [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-11-05 16:03 [Cluster-devel] cluster/cman/daemon cmanccs.c pcaulfield
2007-10-24  5:58 rmccabe
2007-10-24  5:55 rmccabe
2007-10-24  7:27 ` Fabio Massimo Di Nitto
2007-10-24  3:21 fabbione
2007-10-24  3:21 fabbione
2007-10-24  3:20 fabbione
2007-08-17  7:51 pcaulfield
2007-08-03 10:49 pcaulfield
2007-08-03  7:35 pcaulfield
2007-05-23 10:31 pcaulfield
2007-03-15  9:27 pcaulfield
2007-01-02 15:17 pcaulfield
2007-01-02 15:04 pcaulfield
2006-12-15 15:17 pcaulfield
2006-12-15 13:43 pcaulfield
2006-11-30 10:47 pcaulfield
2006-11-30 10:46 pcaulfield
2006-07-03  8:51 pcaulfield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070315111234.26788.qmail@sourceware.org \
    --to=pcaulfield@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).