const struct tsocket_address *local_address;
const struct tsocket_address *remote_address;
const char *remote_hostname;
+ bool has_ctdb_public_ip;
enum protocol_types protocol;
return NT_STATUS_NO_MEMORY;
}
+ if (xconn->client->server_multi_channel_enabled) {
+ struct ctdb_public_ip_list_old *ips = NULL;
+
+ ret = ctdbd_control_get_public_ips(cconn,
+ 0, /* flags */
+ state,
+ &ips);
+ if (ret != 0) {
+ return NT_STATUS_INTERNAL_ERROR;
+ }
+
+ xconn->has_ctdb_public_ip = ctdbd_find_in_public_ips(ips, srv);
+ TALLOC_FREE(ips);
+ if (xconn->has_ctdb_public_ip) {
+ DBG_DEBUG("CTDB public ip on %s\n",
+ smbXsrv_connection_dbg(xconn));
+ }
+ }
+
ret = ctdbd_register_ips(cconn, srv, clnt, release_ip, state);
if (ret != 0) {
return map_nt_error_from_unix(ret);
smbXsrv_connection_dbg(xconn), num_ok,
reason, location);
+ if (xconn->has_ctdb_public_ip) {
+ /*
+ * If the connection has a ctdb public address
+ * we disconnect all client connections,
+ * as the public address might be moved to
+ * a different node.
+ *
+ * In future we may recheck which node currently
+ * holds this address, but for now we keep it simple.
+ */
+ smbd_server_disconnect_client_ex(xconn->client,
+ reason,
+ location);
+ return;
+ }
+
if (num_ok != 0) {
struct tevent_req *subreq = NULL;