]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
- log registering of tcp clients
authorAndrew Tridgell <tridge@samba.org>
Thu, 19 Jul 2007 05:04:54 +0000 (15:04 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 19 Jul 2007 05:04:54 +0000 (15:04 +1000)
- don\'t remove a tcp entry if we do not own the ip
(This used to be ctdb commit 400aa284b9785ce6409e7600df429f5849e3867d)

ctdb/server/ctdb_takeover.c

index 4b7b14ee220dc8ad81bfa9ff7d76ff4adb020b2a..b1d4b190ee374e20146608f3929466c5fba59968 100644 (file)
@@ -644,6 +644,11 @@ int32_t ctdb_control_tcp_client(struct ctdb_context *ctdb, uint32_t client_id, u
        data.dptr = (uint8_t *)&t;
        data.dsize = sizeof(t);
 
+       DEBUG(2,("registered tcp client for %u->%s:%u\n",
+                (unsigned)ntohs(p->dest.sin_port), 
+                inet_ntoa(p->src.sin_addr),
+                (unsigned)ntohs(p->src.sin_port)));
+
        /* tell all nodes about this tcp connection */
        ret = ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_CONNECTED, 0, 
                                       CTDB_CONTROL_TCP_ADD,
@@ -792,9 +797,11 @@ void ctdb_takeover_client_destructor_hook(struct ctdb_client *client)
                p.dest = tcp->daddr;
                data.dptr = (uint8_t *)&p;
                data.dsize = sizeof(p);
-               ctdb_daemon_send_control(client->ctdb, CTDB_BROADCAST_CONNECTED, 0, 
-                                        CTDB_CONTROL_TCP_REMOVE,
-                                        0, CTDB_CTRL_FLAG_NOREPLY, data, NULL, NULL);
+               if (ctdb_sys_have_ip(inet_ntoa(p.dest.sin_addr))) {
+                       ctdb_daemon_send_control(client->ctdb, CTDB_BROADCAST_CONNECTED, 0, 
+                                                CTDB_CONTROL_TCP_REMOVE,
+                                                0, CTDB_CTRL_FLAG_NOREPLY, data, NULL, NULL);
+               }
                talloc_free(tcp);
        }
 }