ctdb-daemon: Do not support connection tracking if there are no public IPs
authorAmitay Isaacs <amitay@gmail.com>
Tue, 11 Feb 2014 07:07:08 +0000 (18:07 +1100)
committerMartin Schwenke <martins@samba.org>
Tue, 4 Mar 2014 02:01:38 +0000 (03:01 +0100)
CTDB tracks connections to be able to send tickle ACKs and gratuitous
ARPs.  When there are no public IPs, there is no need for tickle ACKs
and gratuitous ARPs.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Mar  4 03:01:38 CET 2014 on sn-devel-104

ctdb/server/ctdb_takeover.c

index fe4f472078caa70b14d95244fe550af55d41a37a..34b210ee24be5e46b1a7abc16cd37ed96515c74d 100644 (file)
@@ -2900,6 +2900,11 @@ int32_t ctdb_control_tcp_client(struct ctdb_context *ctdb, uint32_t client_id,
        struct ctdb_vnn *vnn;
        ctdb_sock_addr addr;
 
+       /* If we don't have public IPs, tickles are useless */
+       if (ctdb->vnn == NULL) {
+               return 0;
+       }
+
        switch (indata.dsize) {
        case sizeof(struct ctdb_control_tcp):
                old_addr = (struct ctdb_control_tcp *)indata.dptr;
@@ -3044,6 +3049,11 @@ int32_t ctdb_control_tcp_add(struct ctdb_context *ctdb, TDB_DATA indata, bool tc
        struct ctdb_tcp_connection tcp;
        struct ctdb_vnn *vnn;
 
+       /* If we don't have public IPs, tickles are useless */
+       if (ctdb->vnn == NULL) {
+               return 0;
+       }
+
        vnn = find_public_ip_vnn(ctdb, &p->dst_addr);
        if (vnn == NULL) {
                DEBUG(DEBUG_INFO,(__location__ " got TCP_ADD control for an address which is not a public address '%s'\n",
@@ -3181,6 +3191,11 @@ int32_t ctdb_control_tcp_remove(struct ctdb_context *ctdb, TDB_DATA indata)
 {
        struct ctdb_tcp_connection *conn = (struct ctdb_tcp_connection *)indata.dptr;
 
+       /* If we don't have public IPs, tickles are useless */
+       if (ctdb->vnn == NULL) {
+               return 0;
+       }
+
        ctdb_remove_tcp_connection(ctdb, conn);
 
        return 0;