Skip to content

Commit f65c35d

Browse files
mzaslonkakpm00
authored andcommitted
lib/zlib: DFLTCC always switch to software inflate for Z_PACKET_FLUSH 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]>
1 parent 9010dbc commit f65c35d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/zlib_dfltcc/dfltcc_inflate.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ dfltcc_inflate_action dfltcc_inflate(
9595
struct dfltcc_param_v0 *param = &dfltcc_state->param;
9696
dfltcc_cc cc;
9797

98-
if (flush == Z_BLOCK) {
99-
/* DFLTCC does not support stopping on block boundaries */
98+
if (flush == Z_BLOCK || flush == Z_PACKET_FLUSH) {
99+
/* DFLTCC does not support stopping on block boundaries (Z_BLOCK flush option)
100+
* as well as the use of Z_PACKET_FLUSH option (used exclusively by PPP driver)
101+
*/
100102
if (dfltcc_inflate_disable(strm)) {
101103
*ret = Z_STREAM_ERROR;
102104
return DFLTCC_INFLATE_BREAK;

0 commit comments

Comments
 (0)