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:17:23 +0000 (15:17 +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 29f7acd5b7e95aaea26ee821d9d658bcc6b5a641..a7f125041f3a1314fbd65117409d04d65c819a8d 100644 (file)
@@ -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;
                        }