One of the entry points to release an ip reset the pnn field before invoking the...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 22 Sep 2011 05:13:26 +0000 (15:13 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 22 Sep 2011 05:13:26 +0000 (15:13 +1000)
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

server/ctdb_takeover.c

index 626b10e54540b74f7423e661ec5d3e164f35524d..5865a17d3ae03aab3e32b57976d0df6ff05c82ae 100644 (file)
@@ -3312,13 +3312,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);
@@ -3330,6 +3331,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;
                        }