public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: master - cman: Don't give up on the node config if getnameinfo fails
@ 2009-03-05 10:55 Christine Caulfield
0 siblings, 0 replies; only message in thread
From: Christine Caulfield @ 2009-03-05 10:55 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=5fe4950b64f86a6cd81defdf50bb830f110167f1
Commit: 5fe4950b64f86a6cd81defdf50bb830f110167f1
Parent: ec6cc02f40893680ab424f2c5a98431b491aaea6
Author: Christine Caulfield <ccaulfie@redhat.com>
AuthorDate: Thu Mar 5 10:47:41 2009 +0000
Committer: Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Thu Mar 5 10:47:41 2009 +0000
cman: Don't give up on the node config if getnameinfo fails
If getnameinfo fails to resolve the IP address of an interface then
cman will give up on configration totally rather
than skipping to the next interface. It also gives up if
getnameinfo returns a fully-qualified name and the name in objdb
is a simple name.
This fixes those issues by changing "goto out" into "continue" and
some re-blocking.
In actuality getaddrinfo very rarely seems to fail, so this is not a big
problem, if it cannot resolve an address it returns the IP number as the
string instead of the node name. However I have no doubt that it CAN fail
and will do at inopportune moments. It could be responsible for bz#488565
which, although reported against RHEL5, can affect almost all subsequent
releases.
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
cman/config/cman-preconfig.c | 37 ++++++++++++++++++-------------------
1 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/cman/config/cman-preconfig.c b/cman/config/cman-preconfig.c
index e96c3fa..42c078b 100644
--- a/cman/config/cman-preconfig.c
+++ b/cman/config/cman-preconfig.c
@@ -426,31 +426,30 @@ static int verify_nodename(struct objdb_iface_ver0 *objdb, char *nodename)
error = getnameinfo(sa, sizeof(*sa), nodename2,
sizeof(nodename2), NULL, 0, 0);
- if (error)
- goto out;
+ if (!error) {
- if (nodelist_byname(objdb, cluster_parent_handle, nodename2)) {
- strcpy(nodename, nodename2);
- goto out;
- }
+ if (nodelist_byname(objdb, cluster_parent_handle, nodename2)) {
+ strcpy(nodename, nodename2);
+ goto out;
+ }
- /* truncate this name and try again */
+ /* Truncate this name and try again */
+ dot = strchr(nodename2, '.');
+ if (dot) {
+ *dot = '\0';
- dot = strchr(nodename2, '.');
- if (!dot)
- continue;
- *dot = '\0';
-
- if (nodelist_byname(objdb, cluster_parent_handle, nodename2)) {
- strcpy(nodename, nodename2);
- goto out;
+ if (nodelist_byname(objdb, cluster_parent_handle, nodename2)) {
+ strcpy(nodename, nodename2);
+ 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;
+ continue;
if (nodelist_byname(objdb, cluster_parent_handle, nodename2)) {
strcpy(nodename, nodename2);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-05 10:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-05 10:55 cluster: master - cman: Don't give up on the node config if getnameinfo fails Christine Caulfield
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 read-only IMAP folder(s) and NNTP newsgroup(s).