tipc: Add sanity check to detect rejection of non-payload messages
authorAllan Stephens <allan.stephens@windriver.com>
Mon, 23 May 2011 17:57:25 +0000 (13:57 -0400)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Fri, 24 Jun 2011 20:18:15 +0000 (16:18 -0400)
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>
net/tipc/port.c

index 3946b5b..756e64c 100644 (file)
@@ -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;