diff options
author | Volker Lendecke <vl@samba.org> | 2010-09-29 12:17:05 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-09-30 14:30:33 +0200 |
commit | bad98e37e7e4077a74c7b32d74499c78810192c5 (patch) | |
tree | 0b69670fc18170d7bc5e9ef0be6643c1ef595fa9 /source3/winbindd/winbindd_cm.c | |
parent | 10f0c785c70b89e76f3a9cd3b319262affc9447e (diff) | |
download | samba-bad98e37e7e4077a74c7b32d74499c78810192c5.tar.gz samba-bad98e37e7e4077a74c7b32d74499c78810192c5.tar.bz2 samba-bad98e37e7e4077a74c7b32d74499c78810192c5.zip |
s3: Add "smbcontrol winbindd ip-dropped <local-ip>"
This is supposed to improve the winbind reconnect time after an ip address
has been moved away from a box. Any kind of HA scenario will benefit from
this, because winbindd does not have to wait for the TCP timeout to kick in
when a local IP address has been dropped and DC replies are not received
anymore.
Diffstat (limited to 'source3/winbindd/winbindd_cm.c')
-rw-r--r-- | source3/winbindd/winbindd_cm.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index 4ab2d94aa6..3d84b62652 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -2567,3 +2567,36 @@ NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain, *cli = conn->netlogon_pipe; return NT_STATUS_OK; } + +void winbind_msg_ip_dropped(struct messaging_context *msg_ctx, + void *private_data, + uint32_t msg_type, + struct server_id server_id, + DATA_BLOB *data) +{ + struct winbindd_domain *domain; + + if ((data == NULL) + || (data->data == NULL) + || (data->length == 0) + || (data->data[data->length-1] != '\0') + || !is_ipaddress((char *)data->data)) { + DEBUG(1, ("invalid msg_ip_dropped message\n")); + return; + } + 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) { + continue; + } + client_socket_addr(domain->conn.cli->fd, sockaddr, + sizeof(sockaddr)); + if (strequal(sockaddr, (char *)data->data)) { + close(domain->conn.cli->fd); + domain->conn.cli->fd = -1; + } + } +} |