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

Commit 1219be1e authored by Chris Lew's avatar Chris Lew
Browse files

net: qrtr: Make servers multi state ports



Server state changes should be broadcast throughout the system. Change
the ipc state of a port when it sends a NEW SERVER control packet. This
ensures the DEL CLIENT control packet is propagated correctly for
servers.

Change-Id: I0e4e536b0976e76853531baaf98ffe5237897d9a
Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent f7c9e8fd
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1209,7 +1209,8 @@ static int qrtr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
		goto out_node;
	}

	if (ipc->us.sq_port == QRTR_PORT_CTRL) {
	if (ipc->us.sq_port == QRTR_PORT_CTRL ||
	    addr->sq_port == QRTR_PORT_CTRL) {
		if (len < 4) {
			rc = -EINVAL;
			kfree_skb(skb);
@@ -1220,6 +1221,8 @@ static int qrtr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
		skb_copy_bits(skb, 0, &type, 4);
		type = le32_to_cpu(type);
	}
	if (addr->sq_port == QRTR_PORT_CTRL && type == QRTR_TYPE_NEW_SERVER)
		ipc->state = QRTR_STATE_MULTI;

	rc = enqueue_fn(node, skb, type, &ipc->us, addr, msg->msg_flags);
	if (rc >= 0)