diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2008-04-15 03:15:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-15 03:15:15 -0400 |
commit | 7a8036c2b93c8301afce8f75ac099c347bad569d (patch) | |
tree | d15e614a2d989731fe5a32b3de6c35cf5a568737 /net | |
parent | a198d3a200313bca8261e30e6daaad790937fd7e (diff) |
[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 <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | 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 c1a199c0fa6d..ead22e5eed32 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -1027,7 +1027,7 @@ restart: | |||
1027 | 1027 | ||
1028 | if (!err) { | 1028 | if (!err) { |
1029 | buf_crs = (unsigned char *)(TIPC_SKB_CB(buf)->handle); | 1029 | buf_crs = (unsigned char *)(TIPC_SKB_CB(buf)->handle); |
1030 | sz = skb_tail_pointer(buf) - buf_crs; | 1030 | sz = (unsigned char *)msg + msg_size(msg) - buf_crs; |
1031 | 1031 | ||
1032 | needed = (buf_len - sz_copied); | 1032 | needed = (buf_len - sz_copied); |
1033 | sz_to_copy = (sz <= needed) ? sz : needed; | 1033 | sz_to_copy = (sz <= needed) ? sz : needed; |