Skip to content

Commit

Permalink
tipc: Add sanity check to detect rejection of non-payload messages
Browse files Browse the repository at this point in the history
Introduces an internal sanity check to ensure that the only undeliverable
messages TIPC attempts to return to their origin are application payload
messages.

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 acc631b commit 76d1252
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/tipc/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
imp++;

/* discard rejected message if it shouldn't be returned to sender */

if (WARN(!msg_isdata(msg),
"attempt to reject message with user=%u", msg_user(msg))) {
dump_stack();
goto exit;
}
if (msg_errcode(msg) || msg_dest_droppable(msg))
goto exit;

Expand Down

0 comments on commit 76d1252

Please sign in to comment.