Ver Fonte

Ignore sync barrier msgs if sync doesn't started

On start of corosync, we can receive sync barrier message. If so,
our sync_ring_id is set to NULL, and memcpy of message ring_id will
segfault. Instead of that, sync barrier message is ignored if
sync_ring_id is NULL.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Jan Friesse há 13 anos atrás
pai
commit
ee292e7968
1 ficheiros alterados com 6 adições e 0 exclusões
  1. 6 0
      exec/sync.c

+ 6 - 0
exec/sync.c

@@ -392,6 +392,12 @@ static void sync_deliver_fn (
 		sync_endian_convert (req_exec_sync_barrier_start);
 		sync_endian_convert (req_exec_sync_barrier_start);
 	}
 	}
 
 
+	if (sync_ring_id == NULL) {
+		log_printf (LOGSYS_LEVEL_DEBUG,
+		    "Initial sync was not yet proceed. Ignoring sync msg\n");
+		return ;
+	}
+
 	barrier_completed = 1;
 	barrier_completed = 1;
 
 
 	memcpy (&deliver_ring_id, &req_exec_sync_barrier_start->ring_id,
 	memcpy (&deliver_ring_id, &req_exec_sync_barrier_start->ring_id,