summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2020-06-25 15:32:11 +0200
committerStefan Metzmacher <metze@samba.org>2020-07-08 17:16:40 +0000
commit3afdf2a8618ef9ca7cfba279e87ab59c8ae3d662 (patch)
treed53738953f30827051cc7982289ce0e25d9ada6f
parent79eaa196dc8549ac4676ac055543bf0bfa542264 (diff)
downloadsamba-3afdf2a8618ef9ca7cfba279e87ab59c8ae3d662.tar.gz
s3:smbd: skip ctdb public ips in fsctl_network_iface_info()
Multi-Channel clients should not connect to ctdb public ip addresses (which move between nodes). BUG: https://bugzilla.samba.org/show_bug.cgi?id=11898 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Jul 8 17:16:40 UTC 2020 on sn-devel-184
-rw-r--r--source3/smbd/smb2_ioctl_network_fs.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source3/smbd/smb2_ioctl_network_fs.c b/source3/smbd/smb2_ioctl_network_fs.c
index 8154fa3f92e..f202cddd29c 100644
--- a/source3/smbd/smb2_ioctl_network_fs.c
+++ b/source3/smbd/smb2_ioctl_network_fs.c
@@ -30,6 +30,8 @@
#include "librpc/gen_ndr/ndr_ioctl.h"
#include "smb2_ioctl_private.h"
#include "../lib/tsocket/tsocket.h"
+#include "lib/messages_ctdb.h"
+#include "ctdbd_conn.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_SMB2
@@ -302,6 +304,7 @@ static NTSTATUS fsctl_network_iface_info(TALLOC_CTX *mem_ctx,
size_t i;
size_t num_ifaces = iface_count();
enum ndr_err_code ndr_err;
+ struct ctdb_public_ip_list_old *ips = NULL;
if (in_input->length != 0) {
return NT_STATUS_INVALID_PARAMETER;
@@ -309,6 +312,18 @@ static NTSTATUS fsctl_network_iface_info(TALLOC_CTX *mem_ctx,
*out_output = data_blob_null;
+ if (lp_clustering()) {
+ int ret;
+
+ ret = ctdbd_control_get_public_ips(messaging_ctdb_connection(),
+ 0, /* flags */
+ mem_ctx,
+ &ips);
+ if (ret != 0) {
+ return NT_STATUS_INTERNAL_ERROR;
+ }
+ }
+
array = talloc_zero_array(mem_ctx,
struct fsctl_net_iface_info,
num_ifaces);
@@ -345,6 +360,19 @@ static NTSTATUS fsctl_network_iface_info(TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
+ if (ips != NULL) {
+ bool is_public_ip;
+
+ is_public_ip = ctdbd_find_in_public_ips(ips, ifss);
+ if (is_public_ip) {
+ DBG_DEBUG("Interface [%s] - "
+ "has public ip - "
+ "skipping address [%s].\n",
+ iface->name, addr);
+ continue;
+ }
+ }
+
cur->ifindex = iface->if_index;
if (cur->ifindex == 0) {
/*