__in6_dev_get(9)
β¨ __in6_dev_get(9) β¨
okay so this is a page from the Kernel API Manual bestie, and it's about grabbing an inet6_dev pointer off a netdevice π it's short, it's sweet, it's giving "tiny function, big rules" energy.
πΈ NAME πΈ
__in6_dev_get β get inet6_dev pointer from netdevice
like literally, that's the whole gig π you hand it a netdevice, it hands you back the inet6_dev pointer. slay.
π¦ SYNOPSIS π¦
struct inet6_dev * __in6_dev_get (const struct net_device *dev );
π ARGUMENTS π
devβ network device π that's the netdevice you're pulling the pointer from. that's it. that's the argument.
π₯ DESCRIPTION π₯
okay so listen, this is the important part, do not skip it π
Caller must holdrcu_read_lockorRTNL, because this function does not take a reference on theinet6_dev.
so likeβ¦ the function is lowkey doing zero refcounting for you β no safety net, no little extra hold on the object, nothing π so you have to already be holding either rcu_read_lock or RTNL before you call it. that's the vibe check and you have to pass it. no cap, if you're not holding one of those, that's a you problem and it's giving undefined chaos π
π SEE ALSO π
- Kernel file
./include/net/addrconf.hβ literally the header where this lives, go read it bestie π __in6_dev_stats_get(9)__in6_dev_get_safely(9)β ooh, the safe one, iconic πin6_dev_get(9)
and that's the whole page, bestie π«Ά sign-off time: it's sourced from ./include/net, dated October 2026, and lives under the __in6_dev_get(9) title. mwah πβ¨π
π¦ 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