From 39be874580e96558c1e20d5a0a6dcb062a1f0fac Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Sun, 7 Feb 2016 21:49:36 -0800 Subject: [PATCH] qrtr: Initialize sockaddr_qrtr for node 1 As node 0 is made a valid id in the kernel we're not allowed to specify node 0 when binding our sockets. For now just hard code 1, as that's where we are. Either the kernel should define a reserved node id or we should have a convenient way of specifying the local node, but for now this is good enough. Signed-off-by: Bjorn Andersson --- src/lib.c | 2 +- src/ns.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.c b/src/lib.c index ceab58e..16541fc 100644 --- a/src/lib.c +++ b/src/lib.c @@ -57,7 +57,7 @@ int qrtr_open(int rport) struct sockaddr_qrtr sq; sq.sq_family = AF_QIPCRTR; - sq.sq_node = 0; + sq.sq_node = 1; sq.sq_port = rport; rc = bind(sock, (void *)&sq, sizeof(sq)); diff --git a/src/ns.c b/src/ns.c index 7465cfe..d68c1bb 100644 --- a/src/ns.c +++ b/src/ns.c @@ -415,7 +415,7 @@ static int qrtr_socket(int port) } sq.sq_family = AF_QIPCRTR; - sq.sq_node = 0; + sq.sq_node = 1; sq.sq_port = port; rc = bind(sock, (void *)&sq, sizeof(sq));