From: Ronnie Sahlberg Date: Thu, 22 Sep 2011 05:13:26 +0000 (+1000) Subject: One of the entry points to release an ip reset the pnn field before invoking the... X-Git-Tag: ctdb-1.12~22 X-Git-Url: http://git.samba.org/?p=ctdb.git;a=commitdiff_plain;h=b82524f240bf21769dd7624ca6026763d38b9396 One of the entry points to release an ip reset the pnn field before invoking the eventscript. this triggered a check for "only run the eventscript if we host the address" to trigger and shortcir=cuit calling the eventscript. An effect of this would be that 'ctdb delip' would remove the ip from ctdb, but fail to delete it from the interface. S1028798 --- diff --git a/server/ctdb_takeover.c b/server/ctdb_takeover.c index 29f7acd5..a7f12504 100644 --- a/server/ctdb_takeover.c +++ b/server/ctdb_takeover.c @@ -3370,13 +3370,14 @@ 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) { - ctdb_vnn_unassign_iface(ctdb, vnn); - } if (vnn->pnn != ctdb->pnn) { + if (vnn->iface != NULL) { + ctdb_vnn_unassign_iface(ctdb, vnn); + } talloc_free(vnn); return 0; } + vnn->pnn = -1; mem_ctx = talloc_new(ctdb); talloc_steal(mem_ctx, vnn); @@ -3388,6 +3389,9 @@ 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); + if (vnn->iface != NULL) { + ctdb_vnn_unassign_iface(ctdb, vnn); + } if (ret != 0) { return -1; }