Send Linux-ha-cvs mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."
Today's Topics:
1. Linux-HA CVS: crm by andrew from
([email protected])
2. Linux-HA CVS: heartbeat by xunsun from
([email protected])
3. Linux-HA CVS: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Thu, 16 Feb 2006 02:33:28 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/crmd
Modified Files:
election.c ccm.c
Log Message:
Extra logging for the election loop (bug 1093)
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/election.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -3 -r1.103 -r1.104
--- election.c 10 Feb 2006 06:45:55 -0000 1.103
+++ election.c 16 Feb 2006 09:33:27 -0000 1.104
@@ -267,6 +267,12 @@
} else if(strcmp(fsa_our_uname, vote_from) > 0) {
crm_debug("Election fail: uname");
we_loose = TRUE;
+
+ } else {
+/* CRM_DEV_ASSERT(strcmp(fsa_our_uname, vote_from) < 0); */
+ crm_debug("Them: %s (born=%d) Us: %s (born=%d)",
+ vote_from, your_node->node_born_on,
+ fsa_our_uname, our_node->node_born_on);
/* cant happen...
* } else if(strcmp(fsa_our_uname, vote_from) == 0) {
*
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/ccm.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -3 -r1.97 -r1.98
--- ccm.c 16 Feb 2006 07:56:58 -0000 1.97
+++ ccm.c 16 Feb 2006 09:33:27 -0000 1.98
@@ -1,4 +1,4 @@
-/* $Id: ccm.c,v 1.97 2006/02/16 07:56:58 andrew Exp $ */
+/* $Id: ccm.c,v 1.98 2006/02/16 09:33:27 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -53,7 +53,7 @@
void ghash_update_cib_node(gpointer key, gpointer value, gpointer user_data);
#define CCM_EVENT_DETAIL 0
-#define CCM_EVENT_DETAIL_PARTIAL 1
+#define CCM_EVENT_DETAIL_PARTIAL 0
oc_ev_t *fsa_ev_token;
int num_ccm_register_fails = 0;
------------------------------
Message: 2
Date: Thu, 16 Feb 2006 06:14:49 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: heartbeat by xunsun from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : xunsun
Host :
Project : linux-ha
Module : heartbeat
Dir : linux-ha/heartbeat
Modified Files:
findif.c
Log Message:
check both interface name and broadcast address specified by user
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/findif.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- findif.c 26 Jan 2006 16:46:59 -0000 1.52
+++ findif.c 16 Feb 2006 13:14:49 -0000 1.53
@@ -1,4 +1,4 @@
-/* $Id: findif.c,v 1.52 2006/01/26 16:46:59 davidlee Exp $ */
+/* $Id: findif.c,v 1.53 2006/02/16 13:14:49 xunsun Exp $ */
/*
* findif.c: Finds an interface which can route a given address
*
@@ -51,7 +51,7 @@
* If the broadcast address was omitted, we assume the highest address
* in the subnet.
*
- * If the interfaceis omitted, we choose the interface associated with
+ * If the interface is omitted, we choose the interface associated with
* the route we selected.
*
*
@@ -148,9 +148,11 @@
void ValidateNetmaskBits (char *netmaskbits, unsigned long *netmask);
+int ValidateIFName (const char *ifname, struct ifreq *ifr);
+
int netmask_bits (unsigned long netmask);
-char * get_first_looback_netdev(char * ifname);
+char * get_first_loopback_netdev(char * ifname);
int is_loopback_interface(char * ifname);
char * get_ifname(char * buf, char * ifname);
@@ -451,6 +453,9 @@
/* filter redundancy '/'
* E.g.
'inputaddress=135.9.216.100/24/eth0/'
*/
+ while (**bcast_arg == DELIM) {
+ ++*bcast_arg;
+ }
if ( **bcast_arg == EOS) {
*bcast_arg = NULL;
return;
@@ -498,6 +503,28 @@
}
int
+ValidateIFName(const char *ifname, struct ifreq *ifr)
+{
+ int skfd = -1;
+
+ if ( (skfd = socket(PF_INET, SOCK_DGRAM, 0)) == -1 ) {
+ fprintf(stderr, "%s\n", strerror(errno));
+ return 0;
+ }
+
+ strncpy(ifr->ifr_name, ifname, IFNAMSIZ);
+ if (ioctl(skfd, SIOCGIFFLAGS, ifr) < 0) {
+ fprintf(stderr, "%s: unknown interface: %s\n"
+ , ifr->ifr_name, strerror(errno));
+ close(skfd);
+ /* return -1 only if ifname is known to be invalid */
+ return -1;
+ }
+ close(skfd);
+ return 0;
+}
+
+int
netmask_bits(unsigned long netmask) {
int j;
@@ -513,7 +540,7 @@
}
char *
-get_first_looback_netdev(char * output)
+get_first_loopback_netdev(char * output)
{
char buf[512];
FILE * fd;
@@ -558,25 +585,12 @@
is_loopback_interface(char * ifname)
{
struct ifreq ifr;
- int skfd = -1;
-
- if ( (skfd = socket(PF_INET, SOCK_DGRAM, 0)) == -1 ) {
- fprintf(stderr, "%s\n", strerror(errno));
+ memset(&ifr, 0, sizeof(ifr));
+ if (ValidateIFName(ifname, &ifr) < 0)
return 0;
- }
-
- strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
- if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0) {
- fprintf(stderr, "%s: unknown interface: %s\n"
- , ifname, strerror(errno));
- close(skfd);
- return 0;
- }
- close(skfd);
if (ifr.ifr_flags & IFF_LOOPBACK) {
/* this is a loopback device. */
- close(skfd);
return 1;
} else {
return 0;
@@ -622,6 +636,7 @@
unsigned long netmask;
char best_if[MAXSTR];
char * if_specified = NULL;
+ struct ifreq ifr;
unsigned long best_netmask = INT_MAX;
int argerrs = 0;
@@ -630,6 +645,7 @@
memset(&addr_out, 0, sizeof(addr_out));
memset(&in, 0, sizeof(in));
+ memset(&ifr, 0, sizeof(ifr));
switch (argc) {
case 2: /* No -C argument */
@@ -669,6 +685,9 @@
ValidateNetmaskBits (netmaskbits, &netmask);
if (if_specified != NULL) {
+ if(ValidateIFName(if_specified, &ifr) < 0) {
+ usage();
+ }
strncpy(best_if, if_specified, sizeof(best_if));
*(best_if + sizeof(best_if) - 1) = '\0';
}else{
@@ -705,7 +724,7 @@
My fix may be not good enough, please FIXME
*/
if (0 == strncmp(address, "127", 3)) {
- if (NULL != get_first_looback_netdev(best_if)) {
+ if (NULL != get_first_loopback_netdev(best_if)) {
best_netmask = 0x000000ff;
} else {
fprintf(stderr, "No loopback interface
found.\n");
@@ -722,8 +741,16 @@
/* Did they tell us the broadcast address? */
if (bcast_arg) {
+ /* Yes, they gave us a broadcast address.
+ * It at least should be a valid IP address
+ */
+ struct in_addr bcast_addr;
+ if (inet_pton(AF_INET, bcast_arg, (void *)&bcast_addr) <= 0) {
+ fprintf(stderr, "Invalid broadcast address [%s].",
bcast_arg);
+ usage();
+ }
+
best_netmask = htonl(best_netmask);
- /* Yes, they gave us a broadcast address */
if (!OutputInCIDR) {
printf("%s\t netmask %d.%d.%d.%d\tbroadcast %s\n"
, best_if
@@ -867,6 +894,9 @@
/*
* $Log: findif.c,v $
+ * Revision 1.53 2006/02/16 13:14:49 xunsun
+ * check both interface name and broadcast address specified by user
+ *
* Revision 1.52 2006/01/26 16:46:59 davidlee
* 'ConvertBitsToMask()' was buggy. Remove, replacing with call to OS-native
'inet_pton()'.
*
------------------------------
Message: 3
Date: Thu, 16 Feb 2006 08:15:14 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/crmd
Modified Files:
ccm.c
Log Message:
Clean up the join hashtables when a node leaves the membership
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/ccm.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -3 -r1.98 -r1.99
--- ccm.c 16 Feb 2006 09:33:27 -0000 1.98
+++ ccm.c 16 Feb 2006 15:15:13 -0000 1.99
@@ -1,4 +1,4 @@
-/* $Id: ccm.c,v 1.98 2006/02/16 09:33:27 andrew Exp $ */
+/* $Id: ccm.c,v 1.99 2006/02/16 15:15:13 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -431,8 +431,19 @@
members, member->node_uname, member);
g_hash_table_insert(members, member->node_uname,
member);
+ if(confirmed_nodes != NULL) {
+ g_hash_table_remove(
+ confirmed_nodes, member->node_uname);
+ }
+ if(finalized_nodes != NULL) {
+ g_hash_table_remove(
+ finalized_nodes, member->node_uname);
+ }
+ if(integrated_nodes != NULL) {
+ g_hash_table_remove(
+ integrated_nodes, member->node_uname);
+ }
}
-
} else {
membership_copy->dead_members = NULL;
}
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 27, Issue 67
********************************************