Gitweb:
http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: f21ea8f1c1eba7a641dc3edfbfc14015282f92af
Parent: 234c0749b15ca95277e6ac4ebf9e68234e9b161f
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Thu Aug 18 09:31:36 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Thu Aug 18 10:22:15 2011 +0200
cman: check and set transport only when parsing primary interface
Fix regression introduced in da36fb6bc9e in combination with altname/RRP support
Resolves: rhbz#695795
Reviewed-by: Christine Caulfield <ccaulfie(a)redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/daemon/cman-preconfig.c | 27 +++++++++++++++++----------
1 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index c85331b..7374fa4 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -289,7 +289,10 @@ static int add_udpu_members(struct objdb_iface_ver0 *objdb,
hdb_handle_t interfa
return 0;
}
-static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast, char *ifaddr, int
port, int ttl, enum tx_mech transport)
+#define PRIMARY_IFACE 0
+#define ALT_IFACE 1
+
+static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast, char *ifaddr, int
port, int ttl, int altiface, enum tx_mech transport)
{
hdb_handle_t totem_object_handle;
hdb_handle_t find_handle;
@@ -323,15 +326,17 @@ static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast,
char *ifaddr,
if (objdb->object_find_next(find_handle, &totem_object_handle)) {
objdb->object_create(OBJECT_PARENT_HANDLE, &totem_object_handle,
"totem", strlen("totem"));
- }
+ }
objdb->object_find_destroy(find_handle);
- if (objdb_get_string(objdb, totem_object_handle, "transport",
&transportstr)) {
- objdb->object_key_create_typed(totem_object_handle, "transport",
- tx_mech_to_str[transport], strlen(tx_mech_to_str[transport]) + 1,
OBJDB_VALUETYPE_STRING);
- } else {
- sprintf(error_reason, "Transport should not be specified within <totem
.../>, use <cman transport=\"...\" /> instead");
- return -1;
+ if (!altiface) {
+ if (objdb_get_string(objdb, totem_object_handle, "transport",
&transportstr)) {
+ objdb->object_key_create_typed(totem_object_handle, "transport",
+ tx_mech_to_str[transport], strlen(tx_mech_to_str[transport]) + 1,
OBJDB_VALUETYPE_STRING);
+ } else {
+ sprintf(error_reason, "Transport should not be specified within <totem
.../>, use <cman transport=\"...\" /> instead");
+ return -1;
+ }
}
if (objdb->object_create(totem_object_handle, &interface_object_handle,
@@ -764,7 +769,8 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
}
}
- if (add_ifaddr(objdb, mcast_name, nodename, portnum, ttl, transport)) {
+ if (add_ifaddr(objdb, mcast_name, nodename, portnum, ttl,
+ PRIMARY_IFACE, transport)) {
write_cman_pipe(error_reason);
return -1;
}
@@ -790,7 +796,8 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
mcast = mcast_name;
}
- if (add_ifaddr(objdb, mcast, node, portnum, altttl, transport)) {
+ if (add_ifaddr(objdb, mcast, node, portnum, altttl,
+ ALT_IFACE, transport)) {
write_cman_pipe(error_reason);
return -1;
}