mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
change ctdb_validate_vnn to ctdb_validate_pnn
(This used to be ctdb commit a4a1f41b69475b9dc16d8fd7f8965c32e96c32f0)
This commit is contained in:
parent
eb4cf6a686
commit
fc9d39c3a6
@ -107,9 +107,9 @@ struct ctdb_address {
|
||||
};
|
||||
|
||||
/*
|
||||
check a vnn is valid
|
||||
check that a pnn is valid
|
||||
*/
|
||||
#define ctdb_validate_vnn(ctdb, vnn) (((uint32_t)(vnn)) < (ctdb)->num_nodes)
|
||||
#define ctdb_validate_pnn(ctdb, pnn) (((uint32_t)(pnn)) < (ctdb)->num_nodes)
|
||||
|
||||
|
||||
/* called from the queue code when a packet comes in. Called with data==NULL
|
||||
|
@ -469,7 +469,7 @@ int ctdb_daemon_send_control(struct ctdb_context *ctdb, uint32_t destnode,
|
||||
if (destnode != CTDB_BROADCAST_VNNMAP &&
|
||||
destnode != CTDB_BROADCAST_ALL &&
|
||||
destnode != CTDB_BROADCAST_CONNECTED &&
|
||||
(!ctdb_validate_vnn(ctdb, destnode) ||
|
||||
(!ctdb_validate_pnn(ctdb, destnode) ||
|
||||
(ctdb->nodes[destnode]->flags & NODE_FLAGS_DISCONNECTED))) {
|
||||
if (!(flags & CTDB_CTRL_FLAG_NOREPLY)) {
|
||||
callback(ctdb, -1, tdb_null, "ctdb_control to disconnected node", private_data);
|
||||
|
@ -38,12 +38,12 @@ static void flag_change_handler(struct ctdb_context *ctdb, uint64_t srvid,
|
||||
{
|
||||
struct ctdb_node_flag_change *c = (struct ctdb_node_flag_change *)data.dptr;
|
||||
|
||||
if (data.dsize != sizeof(*c) || !ctdb_validate_vnn(ctdb, c->vnn)) {
|
||||
if (data.dsize != sizeof(*c) || !ctdb_validate_pnn(ctdb, c->vnn)) {
|
||||
DEBUG(0,(__location__ "Invalid data in ctdb_node_flag_change\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ctdb_validate_vnn(ctdb, c->vnn)) {
|
||||
if (!ctdb_validate_pnn(ctdb, c->vnn)) {
|
||||
DEBUG(0,("Bad vnn %u in flag_change_handler\n", c->vnn));
|
||||
return;
|
||||
}
|
||||
@ -809,7 +809,7 @@ static void daemon_request_control_from_client(struct ctdb_client *client,
|
||||
state->client = client;
|
||||
state->c = talloc_steal(state, c);
|
||||
state->reqid = c->hdr.reqid;
|
||||
if (ctdb_validate_vnn(client->ctdb, c->hdr.destnode)) {
|
||||
if (ctdb_validate_pnn(client->ctdb, c->hdr.destnode)) {
|
||||
state->node = client->ctdb->nodes[c->hdr.destnode];
|
||||
DLIST_ADD(state->node->pending_controls, state);
|
||||
} else {
|
||||
|
@ -54,8 +54,8 @@ static void ctdb_unban_node(struct ctdb_recoverd *rec, uint32_t vnn)
|
||||
{
|
||||
struct ctdb_context *ctdb = rec->ctdb;
|
||||
|
||||
if (!ctdb_validate_vnn(ctdb, vnn)) {
|
||||
DEBUG(0,("Bad vnn %u in ctdb_ban_node\n", vnn));
|
||||
if (!ctdb_validate_pnn(ctdb, vnn)) {
|
||||
DEBUG(0,("Bad pnn %u in ctdb_ban_node\n", vnn));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -90,8 +90,8 @@ static void ctdb_ban_node(struct ctdb_recoverd *rec, uint32_t vnn, uint32_t ban_
|
||||
{
|
||||
struct ctdb_context *ctdb = rec->ctdb;
|
||||
|
||||
if (!ctdb_validate_vnn(ctdb, vnn)) {
|
||||
DEBUG(0,("Bad vnn %u in ctdb_ban_node\n", vnn));
|
||||
if (!ctdb_validate_pnn(ctdb, vnn)) {
|
||||
DEBUG(0,("Bad pnn %u in ctdb_ban_node\n", vnn));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ void ctdb_queue_packet(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
|
||||
|
||||
ctdb->statistics.node_packets_sent++;
|
||||
|
||||
if (!ctdb_validate_vnn(ctdb, hdr->destnode)) {
|
||||
if (!ctdb_validate_pnn(ctdb, hdr->destnode)) {
|
||||
DEBUG(0,(__location__ " cant send to node %u that does not exist\n",
|
||||
hdr->destnode));
|
||||
return;
|
||||
|
@ -66,7 +66,7 @@ static void ctdb_recv_pkt(struct ctdb_context *ctdb, uint8_t *data, uint32_t len
|
||||
ctdb->statistics.node_packets_recv++;
|
||||
|
||||
/* up the counter for this source node, so we know its alive */
|
||||
if (ctdb_validate_vnn(ctdb, hdr->srcnode)) {
|
||||
if (ctdb_validate_pnn(ctdb, hdr->srcnode)) {
|
||||
/* as a special case, redirected calls don't increment the rx_cnt */
|
||||
if (hdr->operation != CTDB_REQ_CALL ||
|
||||
((struct ctdb_req_call *)hdr)->hopcount == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user