net: qrtr: Do not do DEL_SERVER broadcast after DEL_CLIENT
authorSricharan Ramabadhran <quic_srichara@quicinc.com>
Mon, 3 Apr 2023 06:58:51 +0000 (12:28 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Apr 2023 09:15:45 +0000 (10:15 +0100)
commit839349d13905927d8a567ca4d21d88c82028e31d
treeb1a79677917fd372d4caaf8f3b373acbbbc5bc9f
parentad651d68cee75e9ac20002254c4e5d09ee67a84b
net: qrtr: Do not do DEL_SERVER broadcast after DEL_CLIENT

On the remote side, when QRTR socket is removed, af_qrtr will call
qrtr_port_remove() which broadcasts the DEL_CLIENT packet to all neighbours
including local NS. NS upon receiving the DEL_CLIENT packet, will remove
the lookups associated with the node:port and broadcasts the DEL_SERVER
packet.

But on the host side, due to the arrival of the DEL_CLIENT packet, the NS
would've already deleted the server belonging to that port. So when the
remote's NS again broadcasts the DEL_SERVER for that port, it throws below
error message on the host:

"failed while handling packet from 2:-2"

So fix this error by not broadcasting the DEL_SERVER packet when the
DEL_CLIENT packet gets processed."

Fixes: 0c2204a4ad71 ("net: qrtr: Migrate nameservice to kernel from userspace")
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Ram Kumar Dharuman <quic_ramd@quicinc.com>
Signed-off-by: Sricharan Ramabadhran <quic_srichara@quicinc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/qrtr/ns.c