From 08d2cf0f74b3ee5e773bb906043a0efe96ded229 Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Mon, 14 Jul 2008 22:44:32 -0700 Subject: [PATCH] tipc: Fix bug in scope checking for multicast messages This patch ensures that TIPC's multicast message name lookup algorithm does individualized scope checking for each published name it examines. Previously, scope checking was only done for the first name in a name table publication list, which could result in incoming multicast messages being delivered to ports publishing names with "node" scope, or not being delivered to ports publishing names with "cluster" or "zone" scope. Signed-off-by: Allan Stephens Signed-off-by: David S. Miller --- net/tipc/name_table.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index 096f7bd240a0..1e53b0c8e73d 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c @@ -710,9 +710,11 @@ int tipc_nametbl_mc_translate(u32 type, u32 lower, u32 upper, u32 limit, if (sseq->lower > upper) break; publ = sseq->cluster_list; - if (publ && (publ->scope <= limit)) + if (publ) do { - if (publ->node == tipc_own_addr) + if (publ->scope > limit) + /* ignore out-of-scope publication */ ; + else if (publ->node == tipc_own_addr) tipc_port_list_add(dports, publ->ref); else res = 1; -- GitLab