diff options
author | David Howells <dhowells@redhat.com> | 2019-10-31 12:13:46 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-31 12:23:09 -0700 |
commit | f9c32435ab7221d1d6cb35738fa85a2da012b23e (patch) | |
tree | aba8c4e4ecddcd677e1e77d1d64464c499b17365 /net/rxrpc/ar-internal.h | |
parent | 5a7ec66782fc2d952b355696114104cc828d6440 (diff) | |
download | linux-f9c32435ab7221d1d6cb35738fa85a2da012b23e.tar.gz linux-f9c32435ab7221d1d6cb35738fa85a2da012b23e.tar.bz2 linux-f9c32435ab7221d1d6cb35738fa85a2da012b23e.zip |
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: 248f219cb8bc ("rxrpc: Rewrite the data and ack handling code")
Fixes: e2de6c404898 ("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>
Diffstat (limited to 'net/rxrpc/ar-internal.h')
-rw-r--r-- | net/rxrpc/ar-internal.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h index ecc17dabec8f..7c7d10f2e0c1 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h @@ -601,6 +601,7 @@ struct rxrpc_call { int debug_id; /* debug ID for printks */ unsigned short rx_pkt_offset; /* Current recvmsg packet offset */ unsigned short rx_pkt_len; /* Current recvmsg packet len */ + bool rx_pkt_last; /* Current recvmsg packet is last */ /* Rx/Tx circular buffer, depending on phase. * |