calipso_sock_setattr(9)
π 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:
netlbl_calipso_ops_register(9)netlbl_calipso_add_pass(9)netlbl_calipso_add(9)netlbl_calipso_list(9)netlbl_calipso_listall_cb(9)netlbl_calipso_listall(9)netlbl_calipso_remove_cb(9)netlbl_calipso_remove(9)netlbl_calipso_genl_init(9)calipso_doi_add(9)calipso_doi_free(9)calipso_doi_remove(9)calipso_doi_getdef(9)calipso_doi_putdef(9)calipso_doi_walk(9)calipso_sock_getattr(9)calipso_sock_delattr(9)calipso_req_setattr(9)calipso_req_delattr(9)calipso_optptr(9)calipso_getattr(9)calipso_skbuff_setattr(9)calipso_skbuff_delattr(9)calipso_cache_invalidate(9)calipso_cache_add(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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms