* [Cluster-devel] cluster/cman/daemon ais.c cmanccs.c
@ 2006-10-02 8:50 pcaulfield
0 siblings, 0 replies; only message in thread
From: pcaulfield @ 2006-10-02 8:50 UTC (permalink / raw)
To: cluster-devel.redhat.com
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;
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-10-02 8:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-02 8:50 [Cluster-devel] cluster/cman/daemon ais.c cmanccs.c pcaulfield
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.