Skip to content

Commit

Permalink
tipc: Don't create payload message using connection protocol routine
Browse files Browse the repository at this point in the history
Modifies the logic that creates a connection termination payload
message so that it no longer (mis)uses a routine that creates a
connection protocol message. The revised code is now more easily
understood, and avoids setting several fields that are either not
present in payload messages or were being set more than once.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
  • Loading branch information
Allan Stephens authored and Paul Gortmaker committed Jun 24, 2011
1 parent 1c1a551 commit f55b564
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions net/tipc/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,14 +539,15 @@ void tipc_port_recv_proto_msg(struct sk_buff *buf)
if (!p_ptr || !p_ptr->connected ||
(port_peernode(p_ptr) != orignode) ||
(port_peerport(p_ptr) != origport)) {
r_buf = port_build_proto_msg(origport,
orignode,
destport,
tipc_own_addr,
TIPC_HIGH_IMPORTANCE,
TIPC_CONN_MSG,
TIPC_ERR_NO_PORT,
0);
r_buf = tipc_buf_acquire(BASIC_H_SIZE);
if (r_buf) {
msg = buf_msg(r_buf);
tipc_msg_init(msg, TIPC_HIGH_IMPORTANCE, TIPC_CONN_MSG,
BASIC_H_SIZE, orignode);
msg_set_errcode(msg, TIPC_ERR_NO_PORT);
msg_set_origport(msg, destport);
msg_set_destport(msg, origport);
}
if (p_ptr)
tipc_port_unlock(p_ptr);
goto exit;
Expand Down

0 comments on commit f55b564

Please sign in to comment.