rtnl_nets_add(9)
π rtnl_nets_add(9) β a Kernel API Manual moment
okay bestie, so this is a page from the Kernel API Manual (section 9, kernel-space vibes only π§) and it's all about rtnl_nets_add. Sit down, hydrate, let's go π
β¨ NAME β¨
rtnl_nets_add β add a netns to be locked before ->newlink(). that's the whole assignment, no cap π
πΈ SYNOPSIS πΈ
void rtnl_nets_add (struct rtnl_nets *rtnl_nets , struct net *net );
notice how it returns void? yeah. it does the thing and dips, iconic behavior honestly π
π¦ ARGUMENTS π¦
rtnl_netsβ thertnl_netspointer that got passed to->get_peer_net. like, that one. π«Άnetβ a netns pointer, and bestie listen: it comes in with an extra refcnt already held. don't touch the refcount, it's handled. π
π DESCRIPTION π
so the extra refcnt we were just talking about? yeah, it gets released later, over in rtnl_nets_destroy. that's it, that's the function. balanced reference counting, main character energy βπ₯
ngl this is one of those tiny helpers where the whole personality is "I hold a ref so the destroy path doesn't have to panic." respect. π
π SEE ALSO π
- Kernel file
./net/core/rtnetlink.c rtnl_unregister(9)rtnl_unregister_all(9)__rtnl_register_many(9)rtnl_link_register(9)rtnl_link_unregister(9)rtnl_af_register(9)rtnl_af_unregister(9)rtnl_get_net_ns_capable(9)ndo_dflt_fdb_dump(9)
and that's the whole page, bestie β no more lore π
signed, sealed, delivered from ./net/core β the Kernel API Manual, dated October 2026, page rtnl_nets_add(9) πβ¨ bye ily π
π¦ 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