浏览代码

Correct nodeid of token when we retransmit it

Although incorrect nodeid will not affect program's logic, but it will
make us confused when we add some logs to record the transmission path of
token in debug mode.

Signed-off-by: Yunkai Zhang <qiushu.zyk@taobao.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
(cherry picked from commit 19652c3d7cf72241907bf7efc3ca0738c66f2039)
Yunkai Zhang 14 年之前
父节点
当前提交
081bfb0a4d
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      exec/totemsrp.c

+ 2 - 1
exec/totemsrp.c

@@ -2685,9 +2685,9 @@ static int token_send (
 	orf_token_size = sizeof (struct orf_token) +
 		(orf_token->rtr_list_entries * sizeof (struct rtr_item));
 
+	orf_token->header.nodeid = instance->my_id.addr[0].nodeid;
 	memcpy (instance->orf_token_retransmit, orf_token, orf_token_size);
 	instance->orf_token_retransmit_size = orf_token_size;
-	orf_token->header.nodeid = instance->my_id.addr[0].nodeid;
 	assert (orf_token->header.nodeid);
 
 	if (forward_token == 0) {
@@ -2867,6 +2867,7 @@ static int memb_state_commit_token_send_recovery (
 	memb_list = (struct memb_commit_token_memb_entry *)(addr + commit_token->addr_entries);
 
 	commit_token->token_seq++;
+	commit_token->header.nodeid = instance->my_id.addr[0].nodeid;
 	commit_token_size = sizeof (struct memb_commit_token) +
 		((sizeof (struct srp_addr) +
 			sizeof (struct memb_commit_token_memb_entry)) * commit_token->addr_entries);