From: Richard Purdie <rpurdie@rpsys.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Stefan Wenk <stefan.wenk@gmx.at>, netdev@vger.kernel.org
Subject: [PATCH] Fix ppp_deflate issues with recent zlib_inflate changes
Date: Thu, 03 May 2007 23:18:09 +0100 [thread overview]
Message-ID: <1178230689.27450.9.camel@localhost.localdomain> (raw)
The last zlib_inflate update broke certain corner cases for ppp_deflate
decompression handling. This patch fixes some logic to make things work
properly again. Users other than ppp_deflate (the only Z_PACKET_FLUSH
user) should be unaffected.
Fixes bug 8405 (confirmed by the reporter).
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Index: linux/lib/zlib_inflate/inflate.c
===================================================================
--- linux.orig/lib/zlib_inflate/inflate.c 2007-05-03 23:08:27.000000000 +0100
+++ linux/lib/zlib_inflate/inflate.c 2007-05-03 23:09:39.000000000 +0100
@@ -743,12 +743,14 @@ int zlib_inflate(z_streamp strm, int flu
strm->data_type = state->bits + (state->last ? 64 : 0) +
(state->mode == TYPE ? 128 : 0);
- if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
- ret = Z_BUF_ERROR;
if (flush == Z_PACKET_FLUSH && ret == Z_OK &&
- (strm->avail_out != 0 || strm->avail_in == 0))
+ strm->avail_out != 0 && strm->avail_in == 0)
return zlib_inflateSyncPacket(strm);
+
+ if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
+ ret = Z_BUF_ERROR;
+
return ret;
}
next reply other threads:[~2007-05-03 22:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-03 22:18 Richard Purdie [this message]
2007-05-04 0:11 ` [PATCH] Fix ppp_deflate issues with recent zlib_inflate changes Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1178230689.27450.9.camel@localhost.localdomain \
--to=rpurdie@rpsys.net \
--cc=akpm@linux-foundation.org \
--cc=netdev@vger.kernel.org \
--cc=stefan.wenk@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).