fixed send of release IP message
authorAndrew Tridgell <tridge@samba.org>
Fri, 8 Aug 2008 12:06:39 +0000 (22:06 +1000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 8 Aug 2008 12:06:39 +0000 (22:06 +1000)
server/ctdb_takeover.c

index 10369d4b2c05175c4b8248fc1d957e337466e66a..53f48c175a14deb14f7513381f15b5d4d49e38f0 100644 (file)
@@ -304,13 +304,18 @@ static void release_ip_callback(struct ctdb_context *ctdb, int status,
        /* send a message to all clients of this node telling them
           that the cluster has been reconfigured and they should
           release any sockets on this IP */
+#if 1
+       strncpy(ip, inet_ntoa(state->addr->ip.sin_addr), sizeof(ip)-1);
+#else
        if (inet_ntop(state->addr->sa.sa_family, &state->addr->sa.sa_data[0], ip, sizeof(ip)) == NULL) {
                DEBUG(DEBUG_ERR, (__location__ " inet_ntop() failed\n"));
        }
-       
+#endif
        data.dptr = (uint8_t *)ip;
        data.dsize = strlen(ip)+1;
 
+       DEBUG(DEBUG_INFO,(__location__ " sending RELEASE_IP for '%s'\n", data.dptr));
+
        ctdb_daemon_send_message(ctdb, ctdb->pnn, CTDB_SRVID_RELEASE_IP, data);
 
        /* kill clients that have registered with this IP */