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 ais.c cmanccs.c
Date: 2 Oct 2006 08:50:04 -0000	[thread overview]
Message-ID: <20061002085004.1988.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2006-10-02 08:50:02

Modified files:
	cman/daemon    : ais.c cmanccs.c 

Log message:
	Don't even start up if the local host name resolves to 127.0.0.1

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/ais.c.diff?cvsroot=cluster&r1=1.40&r2=1.41
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cmanccs.c.diff?cvsroot=cluster&r1=1.20&r2=1.21

--- cluster/cman/daemon/ais.c	2006/09/25 11:38:53	1.40
+++ cluster/cman/daemon/ais.c	2006/10/02 08:50:02	1.41
@@ -285,6 +285,7 @@
 
 int ais_add_ifaddr(char *mcast, char *ifaddr, int portnum)
 {
+	struct totem_ip_address localhost;
 	unsigned int totem_object_handle;
 	unsigned int interface_object_handle;
 	char tmp[132];
@@ -321,10 +322,19 @@
 			if (!ret)
 				ret = totemip_parse(&ifaddrs[num_interfaces], ifaddr,
 						    mcast_addr[num_interfaces].family);
-			if (!ret)
-				num_interfaces++;
-			else
+			if (ret) {
+				errno = EPROTOTYPE;
 				return ret;
+			}
+
+			/* Check it's not bound to localhost, sigh */
+			totemip_localhost(mcast_addr[num_interfaces].family, &localhost);
+			if (totemip_equal(&localhost, &ifaddrs[num_interfaces])) {
+				errno = EADDRINUSE;
+				return -1;
+			}
+
+			num_interfaces++;
 		}
 	}
 
--- cluster/cman/daemon/cmanccs.c	2006/08/15 10:27:13	1.20
+++ cluster/cman/daemon/cmanccs.c	2006/10/02 08:50:02	1.21
@@ -228,7 +228,10 @@
 	for (i = 0; i<num_nodenames; i++) {
 		error = ais_add_ifaddr(mcast[i], nodenames[i], portnums[i]);
 		if (error) {
-			write_cman_pipe("Multicast and node address families differ.");
+			if (errno == EADDRINUSE)
+				write_cman_pipe("Local host name resolves to 127.0.0.1; fix /etc/hosts before starting cluster.");
+			else
+				write_cman_pipe("Multicast and node address families differ.");
 			return error;
 		}
 	}



                 reply	other threads:[~2006-10-02  8:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20061002085004.1988.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).