public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Christine Caulfield <chrissie@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: STABLE3 - fence: Allow IP addresses as node names
Date: Thu, 04 Jun 2009 16:11:00 -0000 [thread overview]
Message-ID: <20090604161057.99168120312@lists.fedorahosted.org> (raw)
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=683f77512f627e47b0c93c814c56029b6cbf2f9e
Commit: 683f77512f627e47b0c93c814c56029b6cbf2f9e
Parent: d2bb3a8ebb7b82bbede868ed970d3548aca21042
Author: Christine Caulfield <ccaulfie@redhat.com>
AuthorDate: Thu Jun 4 17:10:35 2009 +0100
Committer: Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Thu Jun 4 17:10:35 2009 +0100
fence: Allow IP addresses as node names
When checking if a node is a member of the cluster, fenced does a full-string
check of the name. If that doesn't match it then assumes that one of the
names is a FQDN and one is truncated so it starts checking the bit before the
first dot.
If the node names are IP addresses then this will match all of the time for
most clusters. eg: 192.168.2.1 will match 192.168.2.2 because it just
matches the 192. This makes fenced think that the node has rejoined the cluster
because it sees the name in the list of active nodes, and won't fence it.
This patch abandons the match check afer the full-string one if the node
name is found to be an IP address.
bz#504158
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
fence/fenced/member_cman.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/fence/fenced/member_cman.c b/fence/fenced/member_cman.c
index 2f9dbb6..83de8f1 100644
--- a/fence/fenced/member_cman.c
+++ b/fence/fenced/member_cman.c
@@ -1,5 +1,6 @@
#include "fd.h"
#include "config.h"
+#include <arpa/inet.h>
#include <libcman.h>
#define BUFLEN MAX_NODENAME_LEN+1
@@ -33,6 +34,7 @@ void kick_node_from_cluster(int nodeid)
static int name_equal(char *name1, char *name2)
{
char name3[BUFLEN], name4[BUFLEN];
+ char addr1[INET6_ADDRSTRLEN];
int i, len1, len2;
len1 = strlen(name1);
@@ -41,6 +43,16 @@ static int name_equal(char *name1, char *name2)
if (len1 == len2 && !strncmp(name1, name2, len1))
return 1;
+ /*
+ * If the names are IP addresses then don't compare
+ * what is in front of the dots.
+ */
+ if (inet_pton(AF_INET, name1, addr1) == 0)
+ return 0;
+
+ if (inet_pton(AF_INET6, name1, addr1) == 0)
+ return 0;
+
memset(name3, 0, BUFLEN);
memset(name4, 0, BUFLEN);
reply other threads:[~2009-06-04 16:11 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=20090604161057.99168120312@lists.fedorahosted.org \
--to=chrissie@fedoraproject.org \
--cc=cluster-cvs-relay@redhat.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).