From dfae11b03aebcf2b57cdd6541179190e33c01e39 Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Mon, 30 Oct 2017 21:37:19 -0700 Subject: [PATCH] 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 --- lib/libqrtr.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/libqrtr.c b/lib/libqrtr.c index c4e5107..329095d 100644 --- a/lib/libqrtr.c +++ b/lib/libqrtr.c @@ -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)); }