tipc: fix bug during lookup of multicast destination nodes
In commit 232d07b74a
("tipc: improve groupcast scope handling") we
inadvertently broke non-group multicast transmission when changing the
parameter 'domain' to 'scope' in the function
tipc_nametbl_lookup_dst_nodes(). We missed to make the corresponding
change in the calling function, with the result that the lookup always
fails.
A closer anaysis reveals that this parameter is not needed at all.
Non-group multicast is hard coded to use CLUSTER_SCOPE, and in the
current implementation this will be delivered to all matching
destinations except those which are published with NODE_SCOPE on other
nodes. Since such publications never will be visible on the sending node
anyway, it makes no sense to discriminate by scope at all.
We now remove this parameter altogether.
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
273c28bc57
commit
e9a034456a
|
@ -680,8 +680,7 @@ exit:
|
||||||
* - Determines if any node local ports overlap
|
* - Determines if any node local ports overlap
|
||||||
*/
|
*/
|
||||||
void tipc_nametbl_lookup_dst_nodes(struct net *net, u32 type, u32 lower,
|
void tipc_nametbl_lookup_dst_nodes(struct net *net, u32 type, u32 lower,
|
||||||
u32 upper, u32 scope,
|
u32 upper, struct tipc_nlist *nodes)
|
||||||
struct tipc_nlist *nodes)
|
|
||||||
{
|
{
|
||||||
struct sub_seq *sseq, *stop;
|
struct sub_seq *sseq, *stop;
|
||||||
struct publication *publ;
|
struct publication *publ;
|
||||||
|
@ -699,8 +698,7 @@ void tipc_nametbl_lookup_dst_nodes(struct net *net, u32 type, u32 lower,
|
||||||
for (; sseq != stop && sseq->lower <= upper; sseq++) {
|
for (; sseq != stop && sseq->lower <= upper; sseq++) {
|
||||||
info = sseq->info;
|
info = sseq->info;
|
||||||
list_for_each_entry(publ, &info->zone_list, zone_list) {
|
list_for_each_entry(publ, &info->zone_list, zone_list) {
|
||||||
if (publ->scope == scope)
|
tipc_nlist_add(nodes, publ->node);
|
||||||
tipc_nlist_add(nodes, publ->node);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spin_unlock_bh(&seq->lock);
|
spin_unlock_bh(&seq->lock);
|
||||||
|
|
|
@ -105,8 +105,7 @@ int tipc_nametbl_mc_lookup(struct net *net, u32 type, u32 lower, u32 upper,
|
||||||
void tipc_nametbl_build_group(struct net *net, struct tipc_group *grp,
|
void tipc_nametbl_build_group(struct net *net, struct tipc_group *grp,
|
||||||
u32 type, u32 domain);
|
u32 type, u32 domain);
|
||||||
void tipc_nametbl_lookup_dst_nodes(struct net *net, u32 type, u32 lower,
|
void tipc_nametbl_lookup_dst_nodes(struct net *net, u32 type, u32 lower,
|
||||||
u32 upper, u32 domain,
|
u32 upper, struct tipc_nlist *nodes);
|
||||||
struct tipc_nlist *nodes);
|
|
||||||
bool tipc_nametbl_lookup(struct net *net, u32 type, u32 instance, u32 domain,
|
bool tipc_nametbl_lookup(struct net *net, u32 type, u32 instance, u32 domain,
|
||||||
struct list_head *dsts, int *dstcnt, u32 exclude,
|
struct list_head *dsts, int *dstcnt, u32 exclude,
|
||||||
bool all);
|
bool all);
|
||||||
|
|
|
@ -772,7 +772,6 @@ static int tipc_sendmcast(struct socket *sock, struct tipc_name_seq *seq,
|
||||||
struct net *net = sock_net(sk);
|
struct net *net = sock_net(sk);
|
||||||
int mtu = tipc_bcast_get_mtu(net);
|
int mtu = tipc_bcast_get_mtu(net);
|
||||||
struct tipc_mc_method *method = &tsk->mc_method;
|
struct tipc_mc_method *method = &tsk->mc_method;
|
||||||
u32 domain = addr_domain(net, TIPC_CLUSTER_SCOPE);
|
|
||||||
struct sk_buff_head pkts;
|
struct sk_buff_head pkts;
|
||||||
struct tipc_nlist dsts;
|
struct tipc_nlist dsts;
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -788,7 +787,7 @@ static int tipc_sendmcast(struct socket *sock, struct tipc_name_seq *seq,
|
||||||
/* Lookup destination nodes */
|
/* Lookup destination nodes */
|
||||||
tipc_nlist_init(&dsts, tipc_own_addr(net));
|
tipc_nlist_init(&dsts, tipc_own_addr(net));
|
||||||
tipc_nametbl_lookup_dst_nodes(net, seq->type, seq->lower,
|
tipc_nametbl_lookup_dst_nodes(net, seq->type, seq->lower,
|
||||||
seq->upper, domain, &dsts);
|
seq->upper, &dsts);
|
||||||
if (!dsts.local && !dsts.remote)
|
if (!dsts.local && !dsts.remote)
|
||||||
return -EHOSTUNREACH;
|
return -EHOSTUNREACH;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue