]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: qrtr: Reset the node and port ID of broadcast messages
authorArun Kumar Neelakantam <aneela@codeaurora.org>
Wed, 4 Jul 2018 14:19:33 +0000 (19:49 +0530)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:44:07 +0000 (19:44 -0600)
BugLink: https://bugs.launchpad.net/bugs/1835845
[ Upstream commit d27e77a3de2866b0a772803fd03cd667b5ff8a9a ]

All the control messages broadcast to remote routers are using
QRTR_NODE_BCAST instead of using local router NODE ID which cause
the packets to be dropped on remote router due to invalid NODE ID.

Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/qrtr/qrtr.c

index 8b56d5984544981fa2a5844e724b35789724c630..efca2fdd584a3bd73acdfbad6c65d4ddcf7ebd34 100644 (file)
@@ -191,8 +191,13 @@ static int qrtr_node_enqueue(struct qrtr_node *node, struct sk_buff *skb,
        hdr->type = cpu_to_le32(type);
        hdr->src_node_id = cpu_to_le32(from->sq_node);
        hdr->src_port_id = cpu_to_le32(from->sq_port);
-       hdr->dst_node_id = cpu_to_le32(to->sq_node);
-       hdr->dst_port_id = cpu_to_le32(to->sq_port);
+       if (to->sq_port == QRTR_PORT_CTRL) {
+               hdr->dst_node_id = cpu_to_le32(node->nid);
+               hdr->dst_port_id = cpu_to_le32(QRTR_NODE_BCAST);
+       } else {
+               hdr->dst_node_id = cpu_to_le32(to->sq_node);
+               hdr->dst_port_id = cpu_to_le32(to->sq_port);
+       }
 
        hdr->size = cpu_to_le32(len);
        hdr->confirm_rx = 0;