Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
dced9c06
Commit
dced9c06
authored
Feb 10, 2014
by
antirez
Browse files
Cluster: discard bus messages with version != 0.
parent
007e1c7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
dced9c06
...
@@ -1166,9 +1166,10 @@ int clusterProcessPacket(clusterLink *link) {
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment