From: Allan Stephens Date: Tue, 15 Apr 2008 07:15:15 +0000 (-0700) Subject: [TIPC]: Ignore message padding when receiving stream data X-Git-Tag: v2.6.26-rc1~1138^2~83 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=7a8036c2b93c8301afce8f75ac099c347bad569d;p=linux-2.6-omap-h63xx.git [TIPC]: Ignore message padding when receiving stream data 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 Signed-off-by: David S. Miller --- diff --git a/net/tipc/socket.c b/net/tipc/socket.c index c1a199c0fa6..ead22e5eed3 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;