This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: master - cman: Look for IPv6 names that match cluster.conftoo.


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=f3e8b38b29c665b5b4b22e4e8aa95218df914d08
Commit:        f3e8b38b29c665b5b4b22e4e8aa95218df914d08
Parent:        458a162d9d2ac626f7400f16fc782856dd97a31f
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Mon Apr 6 11:15:47 2009 +0100
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Mon Apr 6 11:19:44 2009 +0100

cman: Look for IPv6 names that match cluster.conf too.

cman now looks at addresses that are bound to IPv6 addresses when searching
the interface list rather than just IPv4 ones.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 cman/config/cman-preconfig.c     |   13 +++++++++++--
 config/plugins/ldap/configldap.c |    2 +-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/cman/config/cman-preconfig.c b/cman/config/cman-preconfig.c
index 93e0c42..11860dc 100644
--- a/cman/config/cman-preconfig.c
+++ b/cman/config/cman-preconfig.c
@@ -418,13 +418,22 @@ static int verify_nodename(struct objdb_iface_ver0 *objdb, char *nodename)
 		return -1;
 
 	for (ifa = ifa_list; ifa; ifa = ifa->ifa_next) {
+		socklen_t salen;
+
 		/* Restore this */
 		strcpy(nodename2, nodename);
 		sa = ifa->ifa_addr;
-		if (!sa || sa->sa_family != AF_INET)
+		if (!sa)
+			continue;
+		if (sa->sa_family != AF_INET && sa->sa_family != AF_INET6)
 			continue;
 
-		error = getnameinfo(sa, sizeof(*sa), nodename2,
+		if (sa->sa_family == AF_INET)
+			salen = sizeof(struct sockaddr_in);
+		if (sa->sa_family == AF_INET6)
+			salen = sizeof(struct sockaddr_in6);
+
+		error = getnameinfo(sa, salen, nodename2,
 				    sizeof(nodename2), NULL, 0, 0);
 		if (!error) {
 
diff --git a/config/plugins/ldap/configldap.c b/config/plugins/ldap/configldap.c
index e04c8fc..e2101f4 100644
--- a/config/plugins/ldap/configldap.c
+++ b/config/plugins/ldap/configldap.c
@@ -14,7 +14,7 @@
 #include <corosync/engine/config.h>
 
 /* These are defaults. they can be overridden with environment variables
- *  LDAP_URL & LDAP_BASEDN
+ *  COROSYNC_LDAP_URL & COROSYNC_LDAP_BASEDN
  */
 #define DEFAULT_LDAP_URL "ldap:///";
 #define DEFAULT_LDAP_BASEDN "dc=chrissie,dc=net"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]