when we receive a packet from the network, check explicitely that the
authorRonnie Sahlberg <sahlberg@ronnie>
Wed, 22 Aug 2007 02:53:24 +0000 (12:53 +1000)
committerRonnie Sahlberg <sahlberg@ronnie>
Wed, 22 Aug 2007 02:53:24 +0000 (12:53 +1000)
node is not banned it the call is for a database record. i.e a REQ/REPLY
CALL/DMASTER

if we get such a call while banned, ignore the packet and write an entry
in the logfile

(This used to be ctdb commit 79eb0863609fbb12e28ebf734101b1d3f359b330)

ctdb/server/ctdb_server.c

index e9b6a9a2a51c0dee74cae707676386382d96680d..25e2d22116077969705c0ee524c59685bf70d73d 100644 (file)
@@ -225,6 +225,18 @@ void ctdb_input_pkt(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
        case CTDB_REPLY_CALL:
        case CTDB_REQ_DMASTER:
        case CTDB_REPLY_DMASTER:
+               /* we dont allow these calls when banned */
+               if (ctdb->nodes[ctdb->vnn]->flags & NODE_FLAGS_BANNED) {
+                       DEBUG(0,(__location__ " ctdb operation %u"
+                               " request %u"
+                               " length %u from node %u to %u while node"
+                               " is banned\n",
+                                hdr->operation, hdr->reqid,
+                                hdr->length, 
+                                hdr->srcnode, hdr->destnode));
+                       goto done;
+               }
+
                /* for ctdb_call inter-node operations verify that the
                   remote node that sent us the call is running in the
                   same generation instance as this node