cn_netlink_send(9)
π cn_netlink_send β the Kernel API Manual page, but make it make sense
okay so bestie, welcome to the glow-up of cn_netlink_send(9) β¨ this is a kernel API manual page and it's genuinely iconic once you clock what it does: it sends a message to the specified groups. that's the whole vibe. let's get into it π
β¨ NAME β¨
cn_netlink_send β literally just sends a message to the specified groups. no cap, that's the job π
πΈ SYNOPSIS πΈ
int cn_netlink_send (struct cn_msg *msg , u32 portid , u32 group , gfp_t
gfp_mask );
that's the whole signature, copy it exactly bestie, don't get creative with it π«Ά
π¦ ARGUMENTS π¦
msgβ the message header, with the data attached to it. it's giving "payload with a passport" πportidβ the destination port. if it's non-zero, the message goes to that given port, which honestly should be set to the original sender. keep that in mind, iykyk πgroupβ the destination group, and this one has layers okay:- if
portidandgroupare both zero, then the appropriate group gets searched through all the registered connector users, and the message gets delivered to the group that was created for the user with the same ID as inmsg. sleuthing behavior, main character energy π - if
groupis not zero, the message gets delivered straight to that specified group. no searching, no drama, periodt β¨
- if
gfp_maskβ the GFP mask. that's it, that's the whole description, we love a low-maintenance argument π
π₯ DESCRIPTION π₯
okay so the important stuff: you can safely call this from softirq context π but heads up β it may silently fail under strong memory pressure. like it just won't tell you, it'll ghost you π so don't be surprised.
also, if there are no listeners for the given group, -ESRCH can be returned. no listeners, no delivery, that's the rule π
π SEE ALSO π
- Kernel file
./include/linux/connector.h cn_add_callback(9)cn_del_callback(9)cn_netlink_send_mult(9)
go read those too, they're the friend group π«Ά
and that's the page bestie!! π source and version vibes: this one lives in ./include/linux, dated October 2026 β so yeah, technically from the future, and it ate βπ§π
π¦ 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