- struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
- int olen, seq, r;
- int decode_proto, overflow;
- unsigned char overflow_buf[1];
-
- if (isize <= PPP_HDRLEN + DEFLATE_OVHD) {
- if (state->debug)
- printk(KERN_DEBUG "z_decompress%d: short packet (len=%d)\n",
- state->unit, isize);
- return DECOMP_ERROR;
- }
-
- /* Check the sequence number. */
- seq = (ibuf[PPP_HDRLEN] << 8) + ibuf[PPP_HDRLEN+1];
- if (seq != state->seqno) {
- if (state->debug)
- printk(KERN_DEBUG "z_decompress%d: bad seq # %d, expected %d\n",
- state->unit, seq, state->seqno);
- return DECOMP_ERROR;
- }
- ++state->seqno;
-
- /*
- * Fill in the first part of the PPP header. The protocol field
- * comes from the decompressed data.
- */
- obuf[0] = PPP_ADDRESS(ibuf);
- obuf[1] = PPP_CONTROL(ibuf);
- obuf[2] = 0;
-
- /*
- * Set up to call inflate. We set avail_out to 1 initially so we can
- * look at the first byte of the output and decide whether we have
- * a 1-byte or 2-byte protocol field.
- */
- state->strm.next_in = ibuf + PPP_HDRLEN + DEFLATE_OVHD;
- state->strm.avail_in = isize - (PPP_HDRLEN + DEFLATE_OVHD);
- state->strm.next_out = obuf + 3;
- state->strm.avail_out = 1;
- decode_proto = 1;
- overflow = 0;
-
- /*
- * Call inflate, supplying more input or output as needed.
- */
- for (;;) {
- r = inflate(&state->strm, Z_PACKET_FLUSH);
- if (r != Z_OK) {
- if (state->debug)
- printk(KERN_DEBUG "z_decompress%d: inflate returned %d (%s)\n",
- state->unit, r, (state->strm.msg? state->strm.msg: ""));
- return DECOMP_FATALERROR;
+ struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
+ int olen, seq, r;
+ int decode_proto, overflow;
+ unsigned char overflow_buf[1];
+
+ if (isize <= PPP_HDRLEN + DEFLATE_OVHD) {
+ if (state->debug)
+ printk(KERN_DEBUG "z_decompress%d: short pkt (%d)\n",
+ state->unit, isize);
+ return DECOMP_ERROR;