login
Header Space

 
 

[PATCH 3/7 net-2.6.26] [TIPC]: Ignore message padding when receiving stream data

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Miller <davem@...>
Cc: <netdev@...>, <allan.stephens@...>
Date: Monday, April 14, 2008 - 5:16 pm

This patch ensures that padding bytes appearing at the end of
an incoming TIPC message are not returned as valid stream data.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
 net/tipc/socket.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index c1a199c..ead22e5 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1027,7 +1027,7 @@ restart:
 
 	if (!err) {
 		buf_crs = (unsigned char *)(TIPC_SKB_CB(buf)->handle);
-		sz = skb_tail_pointer(buf) - buf_crs;
+		sz = (unsigned char *)msg + msg_size(msg) - buf_crs;
 
 		needed = (buf_len - sz_copied);
 		sz_to_copy = (sz <= needed) ? sz : needed;
-- 
1.5.3.2

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 3/7 net-2.6.26] [TIPC]: Ignore message padding when r..., Allan Stephens, (Mon Apr 14, 5:16 pm)
speck-geostationary