netlbl_sock_setattr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 β€” true if caller holds the socket lock. if you hold the lock, say true; 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:

  • 0 on success β€” slay, periodt πŸ’–
  • -EDESTADDRREQ if 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:


🫢 cute sign-off: source/version is ./net/netlabel, date is October 2026, and that's the periodt. πŸ’œ
πŸ“¦ where this page comes from