ctdb: Remove double sanity checks from ctdb_tcp_read_cb
authorSwen Schillig <swen@vnet.ibm.com>
Tue, 13 Mar 2018 08:22:45 +0000 (09:22 +0100)
committerMartin Schwenke <martins@samba.org>
Wed, 4 Apr 2018 07:31:04 +0000 (09:31 +0200)
Within ctdb_tcp_read_cb the provided data is checked for sanity,
e.g. correct size and content. This is not required because it was
done already by the caller(queue_process).

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Apr  4 09:31:04 CEST 2018 on sn-devel-144

ctdb/tcp/tcp_io.c

index 3c3b1c167f320f7c4517aa7b0a70de4cb1ada153..0eb8e25eea3aa80dfefa27a67338eb5ae908cbe1 100644 (file)
@@ -56,13 +56,6 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args)
                goto failed;
        }
 
-
-       if (cnt != hdr->length) {
-               DEBUG(DEBUG_ALERT,(__location__ " Bad header length %u expected %u\n", 
-                        (unsigned)hdr->length, (unsigned)cnt));
-               goto failed;
-       }
-
        if (hdr->ctdb_magic != CTDB_MAGIC) {
                DEBUG(DEBUG_ALERT,(__location__ " Non CTDB packet 0x%x rejected\n", 
                         hdr->ctdb_magic));