mirror of
https://github.com/fluencelabs/redis
synced 2025-04-10 11:16:06 +00:00
Cluster: discard bus messages with version != 0.
This commit is contained in:
parent
007e1c7cb2
commit
dced9c0619
@ -1166,9 +1166,10 @@ int clusterProcessPacket(clusterLink *link) {
|
|||||||
type, (unsigned long) totlen);
|
type, (unsigned long) totlen);
|
||||||
|
|
||||||
/* Perform sanity checks */
|
/* Perform sanity checks */
|
||||||
if (totlen < 16) return 1; /* At least signature, totlen, count. */
|
if (totlen < 16) return 1; /* At least signature, version, totlen, count. */
|
||||||
if (hdr->sig[0] != 'R' || hdr->sig[1] != 'C' ||
|
if (hdr->sig[0] != 'R' || hdr->sig[1] != 'C' ||
|
||||||
hdr->sig[2] != 'i' || hdr->sig[3] != 'b') return 1; /* Bad signature. */
|
hdr->sig[2] != 'i' || hdr->sig[3] != 'b') return 1; /* Bad signature. */
|
||||||
|
if (ntohs(hdr->ver) != 0) return 1; /* Can't handle versions other than 0. */
|
||||||
if (totlen > sdslen(link->rcvbuf)) return 1;
|
if (totlen > sdslen(link->rcvbuf)) return 1;
|
||||||
if (type == CLUSTERMSG_TYPE_PING || type == CLUSTERMSG_TYPE_PONG ||
|
if (type == CLUSTERMSG_TYPE_PING || type == CLUSTERMSG_TYPE_PONG ||
|
||||||
type == CLUSTERMSG_TYPE_MEET)
|
type == CLUSTERMSG_TYPE_MEET)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user