浏览代码

tipc: Initialize peer session field of newly created link endpoint

Initializes the peer session number field of a newly created link
endpoint to an invalid value. This eliminates the remote possibility
that it will accidentally match the session number used by the peer
the first time the link is activated, and cause the link to ignore
a valid RESET message.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Allan Stephens 14 年之前
父节点
当前提交
f882cb7684
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      net/tipc/link.c

+ 1 - 0
net/tipc/link.c

@@ -341,6 +341,7 @@ struct link *tipc_link_create(struct tipc_node *n_ptr,
 	memcpy(&l_ptr->media_addr, media_addr, sizeof(*media_addr));
 	memcpy(&l_ptr->media_addr, media_addr, sizeof(*media_addr));
 	l_ptr->owner = n_ptr;
 	l_ptr->owner = n_ptr;
 	l_ptr->checkpoint = 1;
 	l_ptr->checkpoint = 1;
+	l_ptr->peer_session = INVALID_SESSION;
 	l_ptr->b_ptr = b_ptr;
 	l_ptr->b_ptr = b_ptr;
 	link_set_supervision_props(l_ptr, b_ptr->media->tolerance);
 	link_set_supervision_props(l_ptr, b_ptr->media->tolerance);
 	l_ptr->state = RESET_UNKNOWN;
 	l_ptr->state = RESET_UNKNOWN;