smb-d-daemon: pass conn smbd_direct_daemon_send_fd, not daemon state
authorRalph Boehme <slow@samba.org>
Tue, 4 Oct 2016 04:18:24 +0000 (06:18 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 1 Jun 2018 12:35:16 +0000 (14:35 +0200)
libcli/smb/smb_direct_daemon.c

index df91d821805a7b7cf2c3f84c3544a5da5a1ebb2d..795fdacefbc3463e4e3c1fd14da55c3c27b83f1e 100644 (file)
@@ -588,7 +588,7 @@ static NTSTATUS smbd_direct_daemon_listen(
 }
 
 static NTSTATUS smbd_direct_daemon_send_fd(
-       struct smb_direct_daemon_state *daemon_state, int fd);
+       struct smb_direct_daemon_conn *conn, int fd);
 
 static void smbd_direct_daemon_listen_accept_done(struct tevent_req *subreq)
 {
@@ -627,12 +627,12 @@ static void smbd_direct_daemon_listen_accept_done(struct tevent_req *subreq)
                fd, print_sockaddr(laddr_buf, sizeof(laddr_buf), &laddr),
                print_sockaddr(raddr_buf, sizeof(raddr_buf), &raddr));
 
-       status = smbd_direct_daemon_send_fd(daemon_state, fd);
+       status = smbd_direct_daemon_send_fd(conn, fd);
        close(fd);
 }
 
 static NTSTATUS smbd_direct_daemon_send_fd(
-       struct smb_direct_daemon_state *daemon_state, int fd)
+       struct smb_direct_daemon_conn *conn, int fd)
 {
        struct msghdr msg;
        struct iovec iov;
@@ -661,7 +661,7 @@ static NTSTATUS smbd_direct_daemon_send_fd(
                uint8_t buf[fdlen];
                msghdr_prep_fds(&msg, buf, fdlen, &fd, 1);
 
-               ret = sendmsg(daemon_state->listening_conn->conn_fd, &msg, 0);
+               ret = sendmsg(conn->conn_fd, &msg, 0);
                if (ret == -1) {
                        DBG_ERR("BUGBUGBUG: this should be an async func\n");
                        return NT_STATUS_INTERNAL_ERROR;