z_decompress(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– z_decompress πŸ’–

okay so bestie, this is the Kernel API Manual page for z_decompress(9) β€” yes, section 9, kernel land, we love a low-level moment ✨. The whole vibe? Decompress a Deflate-compressed packet. No cap.


✨ NAME ✨

z_decompress β€” decompress a Deflate-compressed packet.

🌸 SYNOPSIS 🌸

int z_decompress (void *arg , unsigned char *ibuf , int isize , unsigned
       char *obuf , int osize );

πŸŽ€ ARGUMENTS πŸŽ€

  • arg β€” pointer to private state for the decompressor. It's the decompressor's own lil stash of private state, okay? πŸ’…
  • ibuf β€” pointer to input (compressed) packet data. The compressed packet tea β˜•
  • isize β€” length of input packet. How many bytes of that compressed packet we're working with.
  • obuf β€” pointer to space for output (decompressed) packet. The spot where the decompressed packet goes ✨
  • osize β€” amount of space available at obuf. The size budget for that output spot.

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the patent-lore part, and it's giving drama: because of patent problems, we return DECOMP_ERROR for errors found by inspecting the input data and for system problems, but we return DECOMP_FATALERROR for any errors which could possibly be said to be being detected "after" decompression. For DECOMP_ERROR, we can issue a CCP reset-request; for DECOMP_FATALERROR, we may be infringing a patent of Motorola's if we do, so we take CCP down instead. πŸ’€

⚠️ bestie, this is the whole patent-coded reason the two error paths are different. Do not flatten it: DECOMP_ERROR can go with a CCP reset-request; with DECOMP_FATALERROR, doing that may infringe a patent of Motorola's, so CCP gets taken down instead.

And then there's this: given that the frame has the correct sequence number and a good FCS, errors such as invalid codes in the input most likely indicate a bug, so we return DECOMP_FATALERROR for them in order to turn off compression, even though they are detected by inspecting the input. It's giving "the vibes say bug," and the response is to turn off compression, periodt.

πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/net/ppp/ppp_deflate.c β€” and the whole squad: z_comp_free(9), z_comp_alloc(9), z_comp_init(9), z_comp_reset(9), z_compress(9), z_comp_stats(9), z_decomp_free(9), z_decomp_alloc(9), z_decomp_init(9), z_decomp_reset(9), z_incomp(9).


mwah πŸ’‹ β€” this page lives under ./drivers/net/ppp, and it's dated October 2026. z_decompress(9) out. 🫢

πŸ“¦ where this page comes from