mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3:winbindd_cm: make use of cli_state_is_connected()
metze
This commit is contained in:
parent
1f50d04a5c
commit
0791a4d5be
@ -1445,12 +1445,10 @@ static void store_current_dc_in_gencache(const char *domain_name,
|
||||
char *key = NULL;
|
||||
char *value = NULL;
|
||||
|
||||
if (cli == NULL) {
|
||||
return;
|
||||
}
|
||||
if (cli->fd == -1) {
|
||||
if (!cli_state_is_connected(cli)) {
|
||||
return;
|
||||
}
|
||||
|
||||
get_peer_addr(cli->fd, addr, sizeof(addr));
|
||||
|
||||
key = current_dc_key(talloc_tos(), domain_name);
|
||||
@ -1718,7 +1716,7 @@ void close_conns_after_fork(void)
|
||||
* so that we don't generate any SMBclose
|
||||
* requests in invalidate_cm_connection()
|
||||
*/
|
||||
if (cli && cli->fd != -1) {
|
||||
if (cli_state_is_connected(domain->conn.cli)) {
|
||||
close(domain->conn.cli->fd);
|
||||
domain->conn.cli->fd = -1;
|
||||
}
|
||||
@ -2739,12 +2737,11 @@ void winbind_msg_ip_dropped(struct messaging_context *msg_ctx,
|
||||
|
||||
for (domain = domain_list(); domain != NULL; domain = domain->next) {
|
||||
char sockaddr[INET6_ADDRSTRLEN];
|
||||
if (domain->conn.cli == NULL) {
|
||||
continue;
|
||||
}
|
||||
if (domain->conn.cli->fd == -1) {
|
||||
|
||||
if (!cli_state_is_connected(domain->conn.cli)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
client_socket_addr(domain->conn.cli->fd, sockaddr,
|
||||
sizeof(sockaddr));
|
||||
if (strequal(sockaddr, addr)) {
|
||||
|
Loading…
Reference in New Issue
Block a user