calipso_sock_setattr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– calipso_sock_setattr β€” like, the kernel API manual, but make it make sense πŸ’–

okay so this is calipso_sock_setattr(9) from the Kernel API Manual section 9, and bestie, it's literally just "put a CALIPSO option on a socket." that's the whole vibe. let's get into it ✨


🌸 NAME 🌸

calipso_sock_setattr β€” Add a CALIPSO option to a socket

like, that's it. that's the job. adding a CALIPSO option to a socket. slay πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int calipso_sock_setattr (struct sock *sk , const struct calipso_doi
*doi_def , const struct netlbl_lsm_secattr *secattr );

it returns an int, and it takes three parameters. keep that in your Notes app, bestie, we're about to go through each one πŸŽ€


✨ ARGUMENTS ✨

  • sk β€” the socket. yep. the socket itself. the main character of this whole story πŸ‘‘
  • doi_def β€” the CALIPSO DOI to use. this is which DOI we're rolling with πŸŒ€
  • secattr β€” the specific security attributes of the socket. the specifics. the details. the ~flavor~ πŸ“

πŸ’œ DESCRIPTION πŸ’œ

so what this does is: it sets the CALIPSO option on the socket you hand it, using the DOI definition and the security attributes you passed in. both of them. together. periodt ✨

okay and this part is important, no cap β€” this function requires exclusive access to sk. which means sk either needs to be in the process of being created, or it needs to be locked. that's the rule. exclusive means exclusive, bestie, don't try to sneak around it πŸ™ˆ

returns zero on success, and negative values on failure. so like, 0 is the happy ending, anything negative is the 😭 ending.

fr fr: if you don't have that exclusive access (creating or locked), you are not supposed to be here. that's a requirement, not a suggestion πŸ’€

🌈 SEE ALSO 🌈

the kernel file lives at ./net/netlabel/netlabel_calipso.c β€” go look, it's giving source code realness 🫢

and here's the whole friend group, all in section 9:


and that's the whole page, bestie 🧚 this came out of ./net/netlabel, dated October 2026, and it's filed under calipso_sock_setattr(9). mwah πŸ’‹ go set some socket attributes, iconically πŸ’–πŸ”₯

πŸ“¦ where this page comes from