1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

Update the delip command

Dont talloc_free(vnn) immediately but postphone it until later when
the eventscript callback has completed.

CQ S1026664

(This used to be ctdb commit 0a99e8742a261b1d3a2c8830f5c19ea6c2c47cad)
This commit is contained in:
Ronnie Sahlberg 2011-07-29 08:41:35 +10:00
parent 87ea4818bf
commit e707f23596

View File

@ -2892,12 +2892,16 @@ int32_t ctdb_control_del_public_address(struct ctdb_context *ctdb, TDB_DATA inda
TALLOC_CTX *mem_ctx;
DLIST_REMOVE(ctdb->vnn, vnn);
if (vnn->iface == NULL) {
if (vnn->iface != NULL) {
ctdb_vnn_unassign_iface(ctdb, vnn);
}
if (vnn->pnn != ctdb->pnn) {
talloc_free(vnn);
return 0;
}
mem_ctx = talloc_new(ctdb);
talloc_steal(mem_ctx, vnn);
ret = ctdb_event_script_callback(ctdb,
mem_ctx, delete_ip_callback, mem_ctx,
false,
@ -2906,8 +2910,6 @@ int32_t ctdb_control_del_public_address(struct ctdb_context *ctdb, TDB_DATA inda
ctdb_vnn_iface_string(vnn),
ctdb_addr_to_str(&vnn->public_address),
vnn->public_netmask_bits);
ctdb_vnn_unassign_iface(ctdb, vnn);
talloc_free(vnn);
if (ret != 0) {
return -1;
}