From: Swen Schillig Date: Tue, 13 Mar 2018 08:22:45 +0000 (+0100) Subject: ctdb: Remove double sanity checks from ctdb_tcp_read_cb X-Git-Tag: talloc-2.1.13~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8f7f42565d35e20ba576db101bd5eb27f90e903;p=thirdparty%2Fsamba.git ctdb: Remove double sanity checks from ctdb_tcp_read_cb 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 Reviewed-by: Martin Schwenke Reviewed-by: Jeremy Allison Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Apr 4 09:31:04 CEST 2018 on sn-devel-144 --- diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c index 3c3b1c167f3..0eb8e25eea3 100644 --- a/ctdb/tcp/tcp_io.c +++ b/ctdb/tcp/tcp_io.c @@ -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));