calipso_cache_check(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ calipso_cache_check β€” bestie edition πŸ’…

okay so this is a page from the Kernel API Manual, and today's main character is calipso_cache_check ✨


✨ NAME ✨

calipso_cache_check β€” check the CALIPSO cache for a label mapping πŸ”


🌸 SYNOPSIS 🌸

int calipso_cache_check (const unsigned char *key , u32 key_len ,
                         struct netlbl_lsm_secattr *secattr );

πŸŽ€ ARGUMENTS πŸŽ€

  • key β€” the buffer you wanna check, that's the vibe
  • key_len β€” how long that buffer is, in bytes, no cap
  • secattr β€” the security attribute struct you're gonna use 🫢

πŸ’– DESCRIPTION πŸ’–

So basically this function peeks into the cache to see if a label mapping already exists for the key you handed it. If there's a match, the cache gets adjusted and the secattr struct gets populated with the correct LSM security attributes. Literally doing the most for you πŸ’…

Now β€” here's the fun part β€” if the entry is not already the first one in the cache bucket, the cache gets adjusted in this exact way:

  1. The cache entry's activity counter gets incremented ⬆️
  2. The previous (higher ranking) entry's activity counter gets decremented ⬇️
  3. If the difference between the two activity counters is "geater" than CALIPSO_CACHE_REORDERLIMIT, the two entries get swapped πŸ”„
the original doc really said "geater" and honestly? we respect the typo. it means greater, bestie 😭

Returns zero on success, -ENOENT for a cache miss, and other negative values on error. periodt. ✨


πŸ”₯ SEE ALSO πŸ”₯

The kernel file lives at ./net/ipv6/calipso.c, and it's giving family reunion, because here's the whole crew:


aaaand that's the page!! 🧚 mwah πŸ’‹

sign-off besties: this one's from the kernel file under ./net/ipv6, dated October 2026, and it's filed as calipso_cache_check(9) β€” go read the whole collection, iykyk πŸ’œπŸŒˆ
πŸ“¦ where this page comes from