summaryrefslogtreecommitdiff
path: root/src/cluster.c
diff options
context:
space:
mode:
authorTian <skylypig@gmail.com>2022-06-28 11:42:55 +0800
committerGitHub <noreply@github.com>2022-06-27 20:42:55 -0700
commit069b30a2b329102d60ba70bd3fd7a1d04284e426 (patch)
tree6bd1a0d7fcbd972794db3e927e777a3531578175 /src/cluster.c
parent6af021007a70f42e41f2a8abda3719d68b15ada4 (diff)
downloadredis-069b30a2b329102d60ba70bd3fd7a1d04284e426.tar.gz
A minor refinement to clusterbus extension estlen (#10902)
Diffstat (limited to 'src/cluster.c')
-rw-r--r--src/cluster.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cluster.c b/src/cluster.c
index e194ce27d..147668a2e 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -2002,7 +2002,7 @@ int writeHostnamePingExt(clusterMsgPingExt **cursor) {
uint32_t extension_size = getHostnamePingExtSize();
/* Move the write cursor */
- (*cursor)->type = CLUSTERMSG_EXT_TYPE_HOSTNAME;
+ (*cursor)->type = htons(CLUSTERMSG_EXT_TYPE_HOSTNAME);
(*cursor)->length = htonl(extension_size);
/* Make sure the string is NULL terminated by adding 1 */
*cursor = (clusterMsgPingExt *) (ext->hostname + EIGHT_BYTE_ALIGN(sdslen(myself->hostname) + 1));
@@ -2921,7 +2921,7 @@ void clusterSendPing(clusterLink *link, int type) {
* to put inside the packet. */
estlen = sizeof(clusterMsg) - sizeof(union clusterMsgData);
estlen += (sizeof(clusterMsgDataGossip)*(wanted + pfail_wanted));
- estlen += sizeof(clusterMsgPingExt) + getHostnamePingExtSize();
+ estlen += getHostnamePingExtSize();
/* Note: clusterBuildMessageHdr() expects the buffer to be always at least
* sizeof(clusterMsg) or more. */