summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2002-05-12 14:12:30 +0000
committerume <ume@FreeBSD.org>2002-05-12 14:12:30 +0000
commit231bd65333821b5737cb98ba31017e3ad59cfee1 (patch)
treeb5f1c3ff258720dce954fdf1de5fc7eac405da2e /sys
parent01532a0d4b3569df9830752607c04c1ef04477e3 (diff)
downloadFreeBSD-src-231bd65333821b5737cb98ba31017e3ad59cfee1.zip
FreeBSD-src-231bd65333821b5737cb98ba31017e3ad59cfee1.tar.gz
Recent zlib does not like Z_FLUSH at the end of inflate().
Reported by: quak@mydiax.ch Obtained from: KAME MFC after: 2 days and approved by re
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/ipcomp_core.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/netinet6/ipcomp_core.c b/sys/netinet6/ipcomp_core.c
index bf12545..62af1bc 100644
--- a/sys/netinet6/ipcomp_core.c
+++ b/sys/netinet6/ipcomp_core.c
@@ -252,14 +252,17 @@ do { \
MOREBLOCK();
}
- zerror = mode ? inflate(&zs, Z_FINISH)
+ zerror = mode ? inflate(&zs, Z_SYNC_FLUSH)
: deflate(&zs, Z_FINISH);
if (zerror == Z_STREAM_END)
break;
- else if (zerror == Z_OK)
- ; /* once more. */
- else {
+ else if (zerror == Z_OK) {
+ if (mode && zs.avail_out != 0)
+ goto terminate;
+ else
+ ; /* once more. */
+ } else {
if (zs.msg) {
ipseclog((LOG_ERR, "ipcomp_%scompress: "
"%sflate(Z_FINISH): %s\n",
OpenPOWER on IntegriCloud