mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
lib: Make ctdbd_register_ips return 0/errno
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
4caf48ecb3
commit
a039463d82
@ -67,14 +67,14 @@ int ctdbd_traverse(struct ctdbd_connection *master, uint32_t db_id,
|
||||
void *private_data),
|
||||
void *private_data);
|
||||
|
||||
NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
|
||||
const struct sockaddr_storage *server,
|
||||
const struct sockaddr_storage *client,
|
||||
int (*cb)(uint32_t src_vnn, uint32_t dst_vnn,
|
||||
uint64_t dst_srvid,
|
||||
const uint8_t *msg, size_t msglen,
|
||||
void *private_data),
|
||||
void *private_data);
|
||||
int ctdbd_register_ips(struct ctdbd_connection *conn,
|
||||
const struct sockaddr_storage *server,
|
||||
const struct sockaddr_storage *client,
|
||||
int (*cb)(uint32_t src_vnn, uint32_t dst_vnn,
|
||||
uint64_t dst_srvid,
|
||||
const uint8_t *msg, size_t msglen,
|
||||
void *private_data),
|
||||
void *private_data);
|
||||
|
||||
NTSTATUS ctdbd_control_local(struct ctdbd_connection *conn, uint32_t opcode,
|
||||
uint64_t srvid, uint32_t flags, TDB_DATA data,
|
||||
|
@ -46,16 +46,16 @@ int register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid,
|
||||
return ENOSYS;
|
||||
}
|
||||
|
||||
NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
|
||||
const struct sockaddr_storage *_server,
|
||||
const struct sockaddr_storage *_client,
|
||||
int (*cb)(uint32_t src_vnn, uint32_t dst_vnn,
|
||||
uint64_t dst_srvid,
|
||||
const uint8_t *msg, size_t msglen,
|
||||
void *private_data),
|
||||
void *private_data)
|
||||
int ctdbd_register_ips(struct ctdbd_connection *conn,
|
||||
const struct sockaddr_storage *_server,
|
||||
const struct sockaddr_storage *_client,
|
||||
int (*cb)(uint32_t src_vnn, uint32_t dst_vnn,
|
||||
uint64_t dst_srvid,
|
||||
const uint8_t *msg, size_t msglen,
|
||||
void *private_data),
|
||||
void *private_data)
|
||||
{
|
||||
return NT_STATUS_NOT_IMPLEMENTED;
|
||||
return ENOSYS;
|
||||
}
|
||||
|
||||
bool ctdb_processes_exist(struct ctdbd_connection *conn,
|
||||
|
@ -1180,14 +1180,14 @@ static void smbd_ctdb_canonicalize_ip(const struct sockaddr_storage *in,
|
||||
* Register us as a server for a particular tcp connection
|
||||
*/
|
||||
|
||||
NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
|
||||
const struct sockaddr_storage *_server,
|
||||
const struct sockaddr_storage *_client,
|
||||
int (*cb)(uint32_t src_vnn, uint32_t dst_vnn,
|
||||
uint64_t dst_srvid,
|
||||
const uint8_t *msg, size_t msglen,
|
||||
void *private_data),
|
||||
void *private_data)
|
||||
int ctdbd_register_ips(struct ctdbd_connection *conn,
|
||||
const struct sockaddr_storage *_server,
|
||||
const struct sockaddr_storage *_client,
|
||||
int (*cb)(uint32_t src_vnn, uint32_t dst_vnn,
|
||||
uint64_t dst_srvid,
|
||||
const uint8_t *msg, size_t msglen,
|
||||
void *private_data),
|
||||
void *private_data)
|
||||
{
|
||||
struct ctdb_control_tcp_addr p;
|
||||
TDB_DATA data = { .dptr = (uint8_t *)&p, .dsize = sizeof(p) };
|
||||
@ -1212,7 +1212,7 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
|
||||
memcpy(&p.src.ip6, &client, sizeof(p.src.ip6));
|
||||
break;
|
||||
default:
|
||||
return NT_STATUS_INTERNAL_ERROR;
|
||||
return EIO;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1222,7 +1222,7 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
|
||||
ret = register_with_ctdbd(conn, CTDB_SRVID_RELEASE_IP,
|
||||
cb, private_data);
|
||||
if (ret != 0) {
|
||||
return map_nt_error_from_unix(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1235,9 +1235,9 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
|
||||
CTDB_CTRL_FLAG_NOREPLY, data, NULL, NULL,
|
||||
NULL);
|
||||
if (ret != 0) {
|
||||
return map_nt_error_from_unix(ret);
|
||||
return ret;
|
||||
}
|
||||
return NT_STATUS_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2693,6 +2693,7 @@ static NTSTATUS smbd_register_ips(struct smbXsrv_connection *xconn,
|
||||
{
|
||||
struct smbd_release_ip_state *state;
|
||||
struct ctdbd_connection *cconn;
|
||||
int ret;
|
||||
|
||||
cconn = messaging_ctdbd_connection();
|
||||
if (cconn == NULL) {
|
||||
@ -2712,7 +2713,11 @@ static NTSTATUS smbd_register_ips(struct smbXsrv_connection *xconn,
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
return ctdbd_register_ips(cconn, srv, clnt, release_ip, state);
|
||||
ret = ctdbd_register_ips(cconn, srv, clnt, release_ip, state);
|
||||
if (ret != 0) {
|
||||
return map_nt_error_from_unix(ret);
|
||||
}
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
static void msg_kill_client_ip(struct messaging_context *msg_ctx,
|
||||
|
Loading…
Reference in New Issue
Block a user