]> git.baikalelectronics.ru Git - kernel.git/commit
rxrpc: Fix handling of last subpacket of jumbo packet
authorDavid Howells <dhowells@redhat.com>
Thu, 31 Oct 2019 12:13:46 +0000 (12:13 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 31 Oct 2019 19:23:09 +0000 (12:23 -0700)
commit5503b11dc9af1b3b6205cd2aecee96c5ff1d6dde
treeaba8c4e4ecddcd677e1e77d1d64464c499b17365
parentea1998a1eddd53bb7c5405684bd93a058bc1d060
rxrpc: Fix handling of last subpacket of jumbo packet

When rxrpc_recvmsg_data() sets the return value to 1 because it's drained
all the data for the last packet, it checks the last-packet flag on the
whole packet - but this is wrong, since the last-packet flag is only set on
the final subpacket of the last jumbo packet.  This means that a call that
receives its last packet in a jumbo packet won't complete properly.

Fix this by having rxrpc_locate_data() determine the last-packet state of
the subpacket it's looking at and passing that back to the caller rather
than having the caller look in the packet header.  The caller then needs to
cache this in the rxrpc_call struct as rxrpc_locate_data() isn't then
called again for this packet.

Fixes: a42fc64729e7 ("rxrpc: Rewrite the data and ack handling code")
Fixes: 85aa2117dd22 ("rxrpc: Use info in skbuff instead of reparsing a jumbo packet")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rxrpc/ar-internal.h
net/rxrpc/recvmsg.c