diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index df3141a2669..5e860ab6d0d 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -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 diff --git a/ctdb/server/ctdb_control.c b/ctdb/server/ctdb_control.c index 09276cd3de4..ca0ea9a937f 100644 --- a/ctdb/server/ctdb_control.c +++ b/ctdb/server/ctdb_control.c @@ -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); diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c index f487434a9bb..0112fd61d11 100644 --- a/ctdb/server/ctdb_daemon.c +++ b/ctdb/server/ctdb_daemon.c @@ -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 { diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index a8097a6387f..e687fe81048 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -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; } diff --git a/ctdb/server/ctdb_server.c b/ctdb/server/ctdb_server.c index 8dabcd595d9..a9ae79bc7ec 100644 --- a/ctdb/server/ctdb_server.c +++ b/ctdb/server/ctdb_server.c @@ -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; diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c index 4083d1539cb..218c6582907 100644 --- a/ctdb/server/ctdbd.c +++ b/ctdb/server/ctdbd.c @@ -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) {