summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-07-11 14:19:55 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-11 18:18:29 +0200
commit0791a4d5beb7565c0ac476f8117b36b57fa5f938 (patch)
tree39d911d24c0aaedc1bd476020bca47245b255507 /source3
parent1f50d04a5cf3ec8909ebf5b7547adef2b16af0cb (diff)
downloadsamba-0791a4d5beb7565c0ac476f8117b36b57fa5f938.tar.gz
samba-0791a4d5beb7565c0ac476f8117b36b57fa5f938.tar.bz2
samba-0791a4d5beb7565c0ac476f8117b36b57fa5f938.zip
s3:winbindd_cm: make use of cli_state_is_connected()
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/winbindd_cm.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 86d6662e5a..c94d6709c4 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -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)) {