Skip to content

Commit

Permalink
lib/zlib: DFLTCC always switch to software inflate for Z_PACKET_FLUSH…
Browse files Browse the repository at this point in the history
… option

Since hardware inflate does not support Z_PACKET_FLUSH option (used
exclusively by kernel PPP driver), always switch to software like we
already do for Z_BLOCK flush option.  Without this patch, PPP might get
Z_DATA_ERROR return code from zlib_inflate() and disable zlib compression
for the packets.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Mikhail Zaslonko <[email protected]>
Acked-by: Ilya Leoshkevich <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Vasily Gorbik <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
mzaslonk authored and akpm00 committed Feb 3, 2023
1 parent 9010dbc commit f65c35d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/zlib_dfltcc/dfltcc_inflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ dfltcc_inflate_action dfltcc_inflate(
struct dfltcc_param_v0 *param = &dfltcc_state->param;
dfltcc_cc cc;

if (flush == Z_BLOCK) {
/* DFLTCC does not support stopping on block boundaries */
if (flush == Z_BLOCK || flush == Z_PACKET_FLUSH) {
/* DFLTCC does not support stopping on block boundaries (Z_BLOCK flush option)
* as well as the use of Z_PACKET_FLUSH option (used exclusively by PPP driver)
*/
if (dfltcc_inflate_disable(strm)) {
*ret = Z_STREAM_ERROR;
return DFLTCC_INFLATE_BREAK;
Expand Down

0 comments on commit f65c35d

Please sign in to comment.