summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/globals.c1
-rw-r--r--source3/smbd/globals.h1
-rw-r--r--source3/smbd/process.c11
3 files changed, 4 insertions, 9 deletions
diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c
index 87d6405ee9..340789ba8e 100644
--- a/source3/smbd/globals.c
+++ b/source3/smbd/globals.c
@@ -110,7 +110,6 @@ int32_t level_II_oplocks_open = 0;
struct kernel_oplocks *koplocks = NULL;
int am_parent = 1;
-int server_fd = -1;
struct memcache *smbd_memcache_ctx = NULL;
bool exit_firsttime = true;
struct child_pid *children = 0;
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 923dd1763c..f4fb4f0b40 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -120,7 +120,6 @@ extern int32_t level_II_oplocks_open;
extern struct kernel_oplocks *koplocks;
extern int am_parent;
-extern int server_fd;
extern struct event_context *smbd_event_ctx;
extern struct messaging_context *smbd_msg_ctx;
extern struct memcache *smbd_memcache_ctx;
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 1ce4ca7263..9535d819dd 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -2410,19 +2410,16 @@ static void msg_release_ip(struct messaging_context *msg_ctx, void *private_data
}
#ifdef CLUSTER_SUPPORT
-static int client_get_tcp_info(struct sockaddr_storage *server,
+static int client_get_tcp_info(int sock, struct sockaddr_storage *server,
struct sockaddr_storage *client)
{
socklen_t length;
- if (server_fd == -1) {
- return -1;
- }
length = sizeof(*server);
- if (getsockname(server_fd, (struct sockaddr *)server, &length) != 0) {
+ if (getsockname(sock, (struct sockaddr *)server, &length) != 0) {
return -1;
}
length = sizeof(*client);
- if (getpeername(server_fd, (struct sockaddr *)client, &length) != 0) {
+ if (getpeername(sock, (struct sockaddr *)client, &length) != 0) {
return -1;
}
return 0;
@@ -3116,7 +3113,7 @@ void smbd_process(struct smbd_server_connection *sconn)
struct sockaddr_storage srv, clnt;
- if (client_get_tcp_info(&srv, &clnt) == 0) {
+ if (client_get_tcp_info(sconn->sock, &srv, &clnt) == 0) {
NTSTATUS status;
status = smbd_register_ips(sconn, &srv, &clnt);
if (!NT_STATUS_IS_OK(status)) {