mirror of
https://github.com/linux-msm/qrtr.git
synced 2026-04-09 14:52:32 +02:00
libqrtr: Don't require socket to be bound for lookup
There's no reason to require that the socket to be bound to a specific port in order to register a lookup, the transmission of the lookup request will autobind the socket to a port for us. Also drop the node and port from the payload, as qrtr-ns will register the lookup on the source sq, rather than the passed port. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
@@ -160,16 +160,9 @@ int qrtr_new_lookup(int sock, uint32_t service, uint16_t version, uint16_t insta
|
||||
|
||||
memset(&pkt, 0, sizeof(pkt));
|
||||
|
||||
if (!sq.sq_port) {
|
||||
LOGE("unable to register server on unbound port");
|
||||
return -1;
|
||||
}
|
||||
|
||||
pkt.cmd = cpu_to_le32(QRTR_CMD_NEW_LOOKUP);
|
||||
pkt.server.service = cpu_to_le32(service);
|
||||
pkt.server.instance = cpu_to_le32(instance << 16 | version);
|
||||
pkt.server.node = cpu_to_le32(sq.sq_node);
|
||||
pkt.server.port = cpu_to_le32(sq.sq_port);
|
||||
|
||||
return qrtr_sendto(sock, sq.sq_node, QRTR_CTRL_PORT, &pkt, sizeof(pkt));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user