netdev_get_by_name(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, this is netdev_get_by_name(9) from the Kernel API Manual β€” the one that is literally β€œfind a device by its name.” iconic behavior, no notes. πŸ’…

🌸 SYNOPSIS 🌸

struct net_device * netdev_get_by_name (struct net *net , const char
       *name , netdevice_tracker *tracker , gfp_t gfp );

πŸŽ€ ARGUMENTS πŸŽ€

  • net β€” the applicable net namespace. that’s the world this lookup lives in. 🌍
  • name β€” name to find. yes, the actual name-name. πŸ”Ž
  • tracker β€” tracking object for the acquired reference. keep track, bestie. 🧚
  • gfp β€” allocation flags for the tracker. the flags go here. 🚩

πŸ¦‹ DESCRIPTION πŸ¦‹

Find an interface by name. This can be called from any context and does its own locking β€” she is self-sufficient, periodt. ✨

The returned handle has the usage count incremented, and the caller must use netdev_put to release it when it is no longer needed. NULL is returned if no matching device is found.

🚨 bestie, the important bit: the returned handle has the usage count incremented, so you must use netdev_put to release it when it is no longer needed. if no matching device is found, you get NULL. don’t leave the ref hanging, fr fr. 😭

🌈 SEE ALSO 🌈

the whole squad is here, no cap:


signed off with love from ./net/core, dated October 2026, for netdev_get_by_name(9) 🫢✨

πŸ“¦ where this page comes from