unix_msg: modify find_send_queue() to take a struct sockaddr_un
authorRalph Boehme <slow@samba.org>
Fri, 19 Aug 2016 14:14:52 +0000 (16:14 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 12 Sep 2016 22:19:26 +0000 (00:19 +0200)
In one of the next commits unix_dgram_send_queue_init() will be moved
into find_send_queue and that takes a struct sockaddr_un.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/unix_msg/unix_msg.c

index 5fac68b7172d2c20c063323de36f786b006635bb..8258f6d46e5ad2a0f57cd5b4b7ce4b449635edb6 100644 (file)
@@ -434,12 +434,12 @@ static void unix_dgram_send_queue_free(struct unix_dgram_send_queue *q)
 }
 
 static struct unix_dgram_send_queue *find_send_queue(
-       struct unix_dgram_ctx *ctx, const char *dst_sock)
+       struct unix_dgram_ctx *ctx, const struct sockaddr_un *dst)
 {
        struct unix_dgram_send_queue *s;
 
        for (s = ctx->send_queues; s != NULL; s = s->next) {
-               if (strcmp(s->path, dst_sock) == 0) {
+               if (strcmp(s->path, dst->sun_path) == 0) {
                        return s;
                }
        }
@@ -604,7 +604,7 @@ static int unix_dgram_send(struct unix_dgram_ctx *ctx,
         * To preserve message ordering, we have to queue a message when
         * others are waiting in line already.
         */
-       q = find_send_queue(ctx, dst->sun_path);
+       q = find_send_queue(ctx, dst);
        if (q != NULL) {
                return queue_msg(q, iov, iovlen, fds, num_fds);
        }