------------------------------------------------------------
revno: 618
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: s3-ctdb-tridge
timestamp: Fri 2007-09-14 19:29:17 +1000
message:
  check return code from CTDB_CONTROL_TCP_CLIENT (this is important as
  we need to refuse connections on other than our public IPs)
modified:
  source/lib/messages.c          messages.c-20070210173807-1wjifrbwaz6xnmgl-491
=== modified file 'source/lib/messages.c'
--- a/source/lib/messages.c     2007-09-11 04:37:10 +0000
+++ b/source/lib/messages.c     2007-09-14 09:29:17 +0000
@@ -1083,6 +1083,7 @@
                }
 
                if (client_get_tcp_info(&p.dest, &p.src) == 0) {
+                       int cstatus;
                        TDB_DATA data;
                        /* inform ctdb of our tcp connection, so if IP takeover 
happens
                           ctdp can send an extra ack to trigger a reset for 
our client,
@@ -1090,9 +1091,14 @@
                        data.dptr = (uint8_t *)&p;
                        data.dsize = sizeof(p);
 
-                       ctdbd_control(ctdbd_ctx, CTDB_CURRENT_NODE, 
-                                     CTDB_CONTROL_TCP_CLIENT, 
-                                     CTDB_CTRL_FLAG_NOREPLY, data, NULL, NULL, 
NULL);
+                       status = ctdbd_control(ctdbd_ctx, CTDB_CURRENT_NODE, 
+                                              CTDB_CONTROL_TCP_CLIENT, 
+                                              CTDB_CTRL_FLAG_NOREPLY, data, 
NULL, NULL, &cstatus);
+                       if (!NT_STATUS_IS_OK(status) || cstatus != 0) {
+                               DEBUG(0,("Failed to register tcp connection 
with ctdbd\n"));
+                               status = NT_STATUS_INTERNAL_ERROR;
+                               goto fail;
+                       }
                } else {
                        DEBUG(2,("Unable to get tcp info for 
CTDB_CONTROL_TCP_CLIENT\n"));
                }

Reply via email to