Currently, messages are delivered to application without testing, if we
know the node (this means, we have no process info about from that node).

Following patch fixes that.
>From 3098d6f74e0fc6ae4f7382f0d7391c461e66fddf Mon Sep 17 00:00:00 2001
From: Jan Friesse <jfrie...@redhat.com>
Date: Thu, 25 Jun 2009 15:27:58 +0200
Subject: [PATCH 1/3] Deliver messages to app only from known nodes

---
 trunk/services/cpg.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/trunk/services/cpg.c b/trunk/services/cpg.c
index 303f7de..652d439 100644
--- a/trunk/services/cpg.c
+++ b/trunk/services/cpg.c
@@ -817,6 +817,22 @@ static void message_handler_req_exec_cpg_mcast (
 	struct list_head *iter;
 	struct cpg_pd *cpd;
 	struct iovec iovec[2];
+	int known_node = 0;
+
+	/* Try to find, if we know the node */
+	for (iter = process_info_list_head.next; iter != &process_info_list_head; iter = iter->next) {
+		struct process_info *pi = list_entry (iter, struct process_info, list);
+
+		if (pi->nodeid == nodeid && mar_name_compare (&pi->group, &req_exec_cpg_mcast->group_name) == 0) {
+			known_node = 1;
+			break;
+		}
+	}
+
+	if (!known_node) {
+		/* Unknown node -> we don't deliver message */
+		return ;
+	}
 
 	res_lib_cpg_mcast.header.id = MESSAGE_RES_CPG_DELIVER_CALLBACK;
 	res_lib_cpg_mcast.header.size = sizeof(res_lib_cpg_mcast) + msglen;
-- 
1.6.2.2

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

Reply via email to