daemon avoid goto ctdb_remove_orphaned_ifaces()
authorGregor Beck <gbeck@sernet.de>
Mon, 31 Mar 2014 06:04:21 +0000 (08:04 +0200)
committerMartin Schwenke <martin@meltin.net>
Wed, 24 Feb 2016 05:58:04 +0000 (16:58 +1100)
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Apr  1 02:59:05 CEST 2014 on sn-devel-104

(Imported from commit 6cdde2711b5b4ad09f9703b2558db7c5d90e9a35)

server/ctdb_takeover.c

index d7f794b8981cf5b8430fffd9fe207377bde64823..8defb68ddde840140628636b0dd72a06709582c8 100644 (file)
@@ -120,18 +120,17 @@ static bool vnn_has_interface_with_name(struct ctdb_vnn *vnn,
 static void ctdb_remove_orphaned_ifaces(struct ctdb_context *ctdb,
                                        struct ctdb_vnn *vnn)
 {
-       struct ctdb_iface *i;
+       struct ctdb_iface *i, *next;
 
        /* For each interface, check if there's an IP using it. */
-       i = ctdb->ifaces;
-       while (i != NULL) {
+       for (i = ctdb->ifaces; i != NULL; i = next) {
                struct ctdb_vnn *tv;
                bool found;
-               struct ctdb_iface *next = i->next;
+               next = i->next;
 
                /* Only consider interfaces named in the given VNN. */
                if (!vnn_has_interface_with_name(vnn, i->name)) {
-                       goto next;
+                       continue;
                }
 
                /* Is the "single IP" on this interface? */
@@ -139,7 +138,7 @@ static void ctdb_remove_orphaned_ifaces(struct ctdb_context *ctdb,
                    (ctdb->single_ip_vnn->ifaces[0] != NULL) &&
                    (strcmp(i->name, ctdb->single_ip_vnn->ifaces[0]) == 0)) {
                        /* Found, next interface please... */
-                       goto next;
+                       continue;
                }
                /* Search for a vnn with this interface. */
                found = false;
@@ -155,9 +154,6 @@ static void ctdb_remove_orphaned_ifaces(struct ctdb_context *ctdb,
                        DLIST_REMOVE(ctdb->ifaces, i);
                        talloc_free(i);
                }
-
-       next:
-               i = next;
        }
 }