summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-01-16 15:51:46 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-01-16 15:51:46 +0100
commit0bb7ccd0b0d245f87aaab71f3deaee49df9c27c7 (patch)
tree9d144da5fa6999e1ec5675164fb386581071e807 /source3
parentf69ac1398770e4c8c211e083bcf526f9a9d99e4a (diff)
parentdc6edf1ab4ae8e3fb3ef40b93135ff0ef5407e12 (diff)
downloadsamba-0bb7ccd0b0d245f87aaab71f3deaee49df9c27c7.tar.gz
samba-0bb7ccd0b0d245f87aaab71f3deaee49df9c27c7.tar.bz2
samba-0bb7ccd0b0d245f87aaab71f3deaee49df9c27c7.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3')
-rw-r--r--source3/include/ctdbd_conn.h4
-rw-r--r--source3/lib/ctdbd_conn.c30
-rw-r--r--source3/modules/vfs_fileid.c8
-rw-r--r--source3/smbd/server.c4
4 files changed, 30 insertions, 16 deletions
diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h
index 44c35168a8..d721235336 100644
--- a/source3/include/ctdbd_conn.h
+++ b/source3/include/ctdbd_conn.h
@@ -57,8 +57,8 @@ NTSTATUS ctdbd_traverse(uint32 db_id,
void *private_data);
NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
- const struct sockaddr *server,
- const struct sockaddr *client,
+ const struct sockaddr_storage *server,
+ const struct sockaddr_storage *client,
void (*release_ip_handler)(const char *ip_addr,
void *private_data),
void *private_data);
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index c94ef802c4..f8dae8fbd6 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -1181,13 +1181,22 @@ NTSTATUS ctdbd_traverse(uint32 db_id,
*/
NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
- const struct sockaddr *server,
- const struct sockaddr *client,
+ const struct sockaddr_storage *server,
+ const struct sockaddr_storage *client,
void (*release_ip_handler)(const char *ip_addr,
void *private_data),
void *private_data)
{
- struct ctdb_control_tcp_vnn p;
+ struct sockaddr *sock = (struct sockaddr *)client;
+ /*
+ * we still use ctdb_control_tcp for ipv4
+ * because we want to work against older ctdb
+ * versions at runtime
+ */
+ struct ctdb_control_tcp p4;
+#ifdef HAVE_IPV6
+ struct ctdb_control_tcp_addr p;
+#endif
TDB_DATA data;
NTSTATUS status;
@@ -1196,15 +1205,19 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
*/
SMB_ASSERT(conn->release_ip_handler == NULL);
- switch (client->sa_family) {
+ switch (sock->sa_family) {
case AF_INET:
- p.dest.ip = *(struct sockaddr_in *)server;
- p.src.ip = *(struct sockaddr_in *)client;
+ p4.dest = *(struct sockaddr_in *)server;
+ p4.src = *(struct sockaddr_in *)client;
+ data.dptr = (uint8_t *)&p4;
+ data.dsize = sizeof(p4);
break;
#ifdef HAVE_IPV6
case AF_INET6:
p.dest.ip6 = *(struct sockaddr_in6 *)server;
p.src.ip6 = *(struct sockaddr_in6 *)client;
+ data.dptr = (uint8_t *)&p;
+ data.dsize = sizeof(p);
break;
#endif
default:
@@ -1227,11 +1240,8 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
* can send an extra ack to trigger a reset for our client, so it
* immediately reconnects
*/
- data.dptr = (uint8_t *)&p;
- data.dsize = sizeof(p);
-
return ctdbd_control(conn, CTDB_CURRENT_NODE,
- CTDB_CONTROL_TCP_ADD, 0,
+ CTDB_CONTROL_TCP_CLIENT, 0,
CTDB_CTRL_FLAG_NOREPLY, data, NULL, NULL, NULL);
}
diff --git a/source3/modules/vfs_fileid.c b/source3/modules/vfs_fileid.c
index 8ab4ac3793..787a49f36b 100644
--- a/source3/modules/vfs_fileid.c
+++ b/source3/modules/vfs_fileid.c
@@ -188,10 +188,16 @@ static int fileid_connect(struct vfs_handle_struct *handle,
return -1;
}
- data->device_mapping_fn = fileid_device_mapping_fsid;
+ /*
+ * "fileid:mapping" is only here as fallback for old setups
+ * "fileid:algorithm" is the option new setups should use
+ */
algorithm = lp_parm_const_string(SNUM(handle->conn),
"fileid", "mapping",
"fsname");
+ algorithm = lp_parm_const_string(SNUM(handle->conn),
+ "fileid", "algorithm",
+ algorithm);
if (strcmp("fsname", algorithm) == 0) {
data->device_mapping_fn = fileid_device_mapping_fsname;
} else if (strcmp("fsid", algorithm) == 0) {
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 00e939e2b8..a884914839 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1458,9 +1458,7 @@ extern void build_options(bool screen);
status = ctdbd_register_ips(
messaging_ctdbd_connection(),
- (struct sockaddr *)&srv,
- (struct sockaddr *)&clnt,
- release_ip, NULL);
+ &srv, &clnt, release_ip, NULL);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("ctdbd_register_ips failed: %s\n",