From mboxrd@z Thu Jan 1 00:00:00 1970 From: pcaulfield@sourceware.org Date: 2 Oct 2006 08:50:04 -0000 Subject: [Cluster-devel] cluster/cman/daemon ais.c cmanccs.c Message-ID: <20061002085004.1988.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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