diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index 30f290a0080..3162bdafaab 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -2877,12 +2877,12 @@ int ctdb_ctrl_get_public_ip_info(struct ctdb_context *ctdb, int ctdb_ctrl_get_ifaces(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, TALLOC_CTX *mem_ctx, - struct ctdb_control_get_ifaces **_ifaces) + struct ctdb_iface_list_old **_ifaces) { int ret; TDB_DATA outdata; int32_t res; - struct ctdb_control_get_ifaces *ifaces; + struct ctdb_iface_list_old *ifaces; uint32_t len; uint32_t i; @@ -2896,7 +2896,7 @@ int ctdb_ctrl_get_ifaces(struct ctdb_context *ctdb, return -1; } - len = offsetof(struct ctdb_control_get_ifaces, ifaces); + len = offsetof(struct ctdb_iface_list_old, ifaces); if (len > outdata.dsize) { DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get ifaces " "returned invalid data with size %u > %u\n", @@ -2906,7 +2906,7 @@ int ctdb_ctrl_get_ifaces(struct ctdb_context *ctdb, return -1; } - ifaces = (struct ctdb_control_get_ifaces *)outdata.dptr; + ifaces = (struct ctdb_iface_list_old *)outdata.dptr; len += ifaces->num*sizeof(struct ctdb_iface); if (len > outdata.dsize) { @@ -2923,7 +2923,7 @@ int ctdb_ctrl_get_ifaces(struct ctdb_context *ctdb, ifaces->ifaces[i].name[CTDB_IFACE_SIZE] = '\0'; } - *_ifaces = (struct ctdb_control_get_ifaces *)talloc_memdup(mem_ctx, + *_ifaces = (struct ctdb_iface_list_old *)talloc_memdup(mem_ctx, outdata.dptr, outdata.dsize); talloc_free(outdata.dptr); diff --git a/ctdb/include/ctdb_client.h b/ctdb/include/ctdb_client.h index 1d0af7ee138..6b5ad6629f1 100644 --- a/ctdb/include/ctdb_client.h +++ b/ctdb/include/ctdb_client.h @@ -384,7 +384,7 @@ int ctdb_ctrl_get_public_ip_info(struct ctdb_context *ctdb, int ctdb_ctrl_get_ifaces(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, TALLOC_CTX *mem_ctx, - struct ctdb_control_get_ifaces **ifaces); + struct ctdb_iface_list_old **ifaces); int ctdb_ctrl_set_iface_link(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, TALLOC_CTX *mem_ctx, diff --git a/ctdb/include/ctdb_protocol.h b/ctdb/include/ctdb_protocol.h index cccacea7f3b..9dd701dfc48 100644 --- a/ctdb/include/ctdb_protocol.h +++ b/ctdb/include/ctdb_protocol.h @@ -1001,7 +1001,7 @@ struct ctdb_public_ip_info_old { struct ctdb_iface ifaces[1]; }; -struct ctdb_control_get_ifaces { +struct ctdb_iface_list_old { uint32_t num; struct ctdb_iface ifaces[1]; }; diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index e178b8bc0a6..1f58109f7a9 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -248,7 +248,7 @@ struct ctdb_recoverd { struct srvid_requests *reallocate_requests; struct ctdb_op_state *takeover_run; struct ctdb_op_state *recovery; - struct ctdb_control_get_ifaces *ifaces; + struct ctdb_iface_list_old *ifaces; uint32_t *force_rebalance_nodes; struct ctdb_node_capabilities *caps; }; @@ -3255,7 +3255,7 @@ static enum monitor_result verify_recmaster(struct ctdb_recoverd *rec, struct ct static bool interfaces_have_changed(struct ctdb_context *ctdb, struct ctdb_recoverd *rec) { - struct ctdb_control_get_ifaces *ifaces = NULL; + struct ctdb_iface_list_old *ifaces = NULL; TALLOC_CTX *mem_ctx; bool ret = false; diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index a9b74c357c9..a4175578679 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -3312,7 +3312,7 @@ int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb, TDB_DATA *outdata) { int i, num, len; - struct ctdb_control_get_ifaces *ifaces; + struct ctdb_iface_list_old *ifaces; struct ctdb_interface *cur; /* count how many public ip structures we have */ @@ -3321,7 +3321,7 @@ int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb, num++; } - len = offsetof(struct ctdb_control_get_ifaces, ifaces) + + len = offsetof(struct ctdb_iface_list_old, ifaces) + num*sizeof(struct ctdb_iface); ifaces = talloc_zero_size(outdata, len); CTDB_NO_MEMORY(ctdb, ifaces); @@ -3334,7 +3334,7 @@ int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb, i++; } ifaces->num = i; - len = offsetof(struct ctdb_control_get_ifaces, ifaces) + + len = offsetof(struct ctdb_iface_list_old, ifaces) + i*sizeof(struct ctdb_iface); outdata->dsize = len; diff --git a/ctdb/tests/src/ctdb_test.c b/ctdb/tests/src/ctdb_test.c index 7afc00d6dca..0ef8b8e188a 100644 --- a/ctdb/tests/src/ctdb_test.c +++ b/ctdb/tests/src/ctdb_test.c @@ -114,7 +114,7 @@ int ctdb_ctrl_getnodesfile(struct ctdb_context *ctdb, int ctdb_ctrl_get_ifaces(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, TALLOC_CTX *mem_ctx, - struct ctdb_control_get_ifaces **ifaces); + struct ctdb_iface_list_old **ifaces); int ctdb_ctrl_getpnn(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode); int ctdb_ctrl_getrecmode(struct ctdb_context *ctdb, diff --git a/ctdb/tests/src/ctdb_test_stubs.c b/ctdb/tests/src/ctdb_test_stubs.c index ff01f88483f..cd9c97e7bad 100644 --- a/ctdb/tests/src/ctdb_test_stubs.c +++ b/ctdb/tests/src/ctdb_test_stubs.c @@ -544,7 +544,7 @@ int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb, TDB_DATA *outdata) { int i, num, len; - struct ctdb_control_get_ifaces *ifaces; + struct ctdb_iface_list_old *ifaces; struct ctdb_interface *cur; assert_ifaces_set(ctdb); @@ -555,7 +555,7 @@ int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb, num++; } - len = offsetof(struct ctdb_control_get_ifaces, ifaces) + + len = offsetof(struct ctdb_iface_list_old, ifaces) + num*sizeof(struct ctdb_iface); ifaces = talloc_zero_size(outdata, len); CTDB_NO_MEMORY(ctdb, ifaces); @@ -573,7 +573,7 @@ int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb, i++; } ifaces->num = i; - len = offsetof(struct ctdb_control_get_ifaces, ifaces) + + len = offsetof(struct ctdb_iface_list_old, ifaces) + i*sizeof(struct ctdb_iface); outdata->dsize = len; @@ -586,7 +586,7 @@ int ctdb_ctrl_get_ifaces_stub(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, TALLOC_CTX *mem_ctx, - struct ctdb_control_get_ifaces **ifaces) + struct ctdb_iface_list_old **ifaces) { TDB_DATA *outdata; int ret; @@ -600,7 +600,7 @@ ctdb_ctrl_get_ifaces_stub(struct ctdb_context *ctdb, ret = ctdb_control_get_ifaces(ctdb, NULL, outdata); if (ret == 0) { - *ifaces = (struct ctdb_control_get_ifaces *)outdata->dptr; + *ifaces = (struct ctdb_iface_list_old *)outdata->dptr; } return ret; diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 2d6a022e2ed..5fb1ef456d4 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -961,7 +961,7 @@ static bool is_partially_online(struct ctdb_context *ctdb, struct ctdb_node_and_ bool ret = false; if (node->flags == 0) { - struct ctdb_control_get_ifaces *ifaces; + struct ctdb_iface_list_old *ifaces; if (ctdb_ctrl_get_ifaces(ctdb, TIMELIMIT(), node->pnn, tmp_ctx, &ifaces) == 0) { @@ -3138,7 +3138,7 @@ static int control_ifaces(struct ctdb_context *ctdb, int argc, const char **argv { TALLOC_CTX *tmp_ctx = talloc_new(ctdb); int i; - struct ctdb_control_get_ifaces *ifaces; + struct ctdb_iface_list_old *ifaces; int ret; /* read the public ip list from this node */