Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102683
b: refs/heads/master
c: a686e68
h: refs/heads/master
i:
  102681: e8fa4b8
  102679: 11d46cd
v: v3
  • Loading branch information
Allan Stephens authored and David S. Miller committed Jun 5, 2008
1 parent 28308e2 commit 54463f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e0d4e3d0d72cfae7b7eac14e39e12dfc6b406313
refs/heads/master: a686e6859e976712e28f6af927cd52a6a3bb372a
17 changes: 12 additions & 5 deletions trunk/net/tipc/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
#include "bcast.h"


/*
* Out-of-range value for link session numbers
*/

#define INVALID_SESSION 0x10000

/*
* Limit for deferred reception queue:
*/
Expand Down Expand Up @@ -464,7 +470,7 @@ struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer,
msg = l_ptr->pmsg;
msg_init(msg, LINK_PROTOCOL, RESET_MSG, TIPC_OK, INT_H_SIZE, l_ptr->addr);
msg_set_size(msg, sizeof(l_ptr->proto_msg));
msg_set_session(msg, tipc_random);
msg_set_session(msg, (tipc_random & 0xffff));
msg_set_bearer_id(msg, b_ptr->identity);
strcpy((char *)msg_data(msg), if_name);

Expand Down Expand Up @@ -705,10 +711,10 @@ void tipc_link_reset(struct link *l_ptr)
u32 checkpoint = l_ptr->next_in_no;
int was_active_link = tipc_link_is_active(l_ptr);

msg_set_session(l_ptr->pmsg, msg_session(l_ptr->pmsg) + 1);
msg_set_session(l_ptr->pmsg, ((msg_session(l_ptr->pmsg) + 1) & 0xffff));

/* Link is down, accept any session: */
l_ptr->peer_session = 0;
/* Link is down, accept any session */
l_ptr->peer_session = INVALID_SESSION;

/* Prepare for max packet size negotiation */
link_init_max_pkt(l_ptr);
Expand Down Expand Up @@ -2275,7 +2281,8 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf)
switch (msg_type(msg)) {

case RESET_MSG:
if (!link_working_unknown(l_ptr) && l_ptr->peer_session) {
if (!link_working_unknown(l_ptr) &&
(l_ptr->peer_session != INVALID_SESSION)) {
if (msg_session(msg) == l_ptr->peer_session) {
dbg("Duplicate RESET: %u<->%u\n",
msg_session(msg), l_ptr->peer_session);
Expand Down

0 comments on commit 54463f3

Please sign in to comment.