netlbl_sock_setattr(9)
π NAME π
netlbl_sock_setattr β label a socket using the correct protocol. no cap, that's the whole vibe. π
okay bestie, this page is netlbl_sock_setattr(9) from the Kernel API Manual, and it's literally about giving your socket the right label. main character energy only. β¨
β¨ SYNOPSIS β¨
int netlbl_sock_setattr (struct sock *sk , u16 family , const struct
netlbl_lsm_secattr *secattr , bool sk_locked );
π ARGUMENTS π
skβ the socket to label. the actual socket getting the label, bestie. πfamilyβ protocol family. yes, the protocol family. πsecattrβ the security attributes. this is the label tea. πsk_lockedβtrueif caller holds the socket lock. if you hold the lock, saytrue; iykyk π
π DESCRIPTION π
okay so the way that this works is: attach the correct label to the given socket using the security attributes specified in secattr. that's it, that's the slay. β¨
but the vibe check is serious: this function requires exclusive access to sk, which means it either needs to be in the process of being created or locked. no cap, exclusive access is not optional here. π
returns:
0on success β slay, periodt π-EDESTADDRREQif the domain is configured to use network address selectors (can't blindly label the socket) β not the vibe π- negative values on all other failures β yeah, negative = not it π
π SEE ALSO π
the kernel file is ./net/netlabel/netlabel_kapi.c, and the whole reference squad is:
netlbl_cfg_map_del(9)netlbl_cfg_unlbl_map_add(9)netlbl_cfg_unlbl_static_add(9)netlbl_cfg_unlbl_static_del(9)netlbl_cfg_cipsov4_add(9)netlbl_cfg_cipsov4_del(9)netlbl_cfg_cipsov4_map_add(9)netlbl_cfg_calipso_add(9)netlbl_cfg_calipso_del(9)netlbl_cfg_calipso_map_add(9)_netlbl_catmap_getnode(9)netlbl_catmap_walk(9)netlbl_catmap_walkrng(9)netlbl_catmap_getlong(9)netlbl_catmap_setbit(9)netlbl_catmap_setrng(9)netlbl_catmap_setlong(9)netlbl_bitmap_walk(9)netlbl_bitmap_setbit(9)netlbl_enabled(9)netlbl_sock_delattr(9)netlbl_sock_getattr(9)netlbl_sk_lock_check(9)netlbl_conn_setattr(9)netlbl_req_setattr(9)netlbl_req_delattr(9)netlbl_skbuff_setattr(9)netlbl_skbuff_getattr(9)netlbl_skbuff_err(9)netlbl_cache_invalidate(9)netlbl_cache_add(9)netlbl_audit_start(9)netlbl_init(9)
π«Ά cute sign-off: source/version is./net/netlabel, date isOctober 2026, and that's the periodt. π
π¦ 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