Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aead5863 authored by Manoharan Vijaya Raghavan's avatar Manoharan Vijaya Raghavan Committed by Gerrit - the friendly Code Review server
Browse files

net: qrtr: ns: Fix Announce services for all nodes



ns service was notifying only local node ID services after
a pci disconnect and reconnect. Fix it to iterate over all
nodes and announce services of all nodes.

Change-Id: I4f91a71ad847b815318a7de47134f6b9c57dff53
Signed-off-by: default avatarManoharan Vijaya Raghavan <mraghava@codeaurora.org>
parent f1cc6d4b
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -227,13 +227,15 @@ static int announce_servers(struct sockaddr_qrtr *sq)
	struct qrtr_server *srv;
	struct qrtr_node *node;
	unsigned long index;
	unsigned long node_idx;
	int ret;

	node = node_get(qrtr_ns.local_node);
	if (!node)
		return 0;

	/* Announce the list of servers registered in this node */
	xa_for_each(&nodes, node_idx, node) {
		if (node->id == sq->sq_node) {
			pr_info("Avoiding duplicate announce for NODE ID %u\n", node->id);
			continue;
		}
		xa_for_each(&node->servers, index, srv) {
			ret = service_announce_new(sq, srv);
			if (ret < 0) {
@@ -244,7 +246,7 @@ static int announce_servers(struct sockaddr_qrtr *sq)
				return ret;
			}
		}

	}
	return 0;
}