Backport of corosync patch

a memb_join operation that occurs during flushing can result in an
entry into the GATHER state from the RECOVERY state.  This results in the
regular sort queue being used instead of the recovery sort queue, resulting
in segfault.

Signed-off-by: Jan Friesse <jfrie...@redhat.com>
---
 branches/whitetank/exec/totemnet.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/branches/whitetank/exec/totemnet.c 
b/branches/whitetank/exec/totemnet.c
index 154aa4f..7b618ec 100644
--- a/branches/whitetank/exec/totemnet.c
+++ b/branches/whitetank/exec/totemnet.c
@@ -77,6 +77,8 @@
 #define BIND_STATE_REGULAR     1
 #define BIND_STATE_LOOPBACK    2
 
+#define MESSAGE_TYPE_MCAST     1
+
 #define HMAC_HASH_SIZE 20
 struct security_header {
        unsigned char hash_digest[HMAC_HASH_SIZE]; /* The hash *MUST* be first 
in the data structure */
@@ -633,6 +635,7 @@ static int net_deliver_fn (
        int res = 0;
        unsigned char *msg_offset;
        unsigned int size_delv;
+       char *message_type;
 
        if (instance->flushing == 1) {
                iovec = &instance->totemnet_iov_recv_flush;
@@ -704,6 +707,16 @@ static int net_deliver_fn (
        }
 
        /*
+        * Drop all non-mcast messages (more specifically join
+        * messages should be dropped)
+        */
+       message_type = (char *)msg_offset;
+       if (instance->flushing == 1 && *message_type != MESSAGE_TYPE_MCAST) {
+               iovec->iov_len = FRAME_SIZE_MAX;
+               return (0);
+       }
+
+       /*
         * Handle incoming message
         */
        instance->totemnet_deliver_fn (
-- 
1.7.4.1

_______________________________________________
Openais mailing list
Openais@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to