dev_getbyhwaddr_rcu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay so bestie, this is dev_getbyhwaddr_rcu(9) from the Kernel API Manual β€” it’s literally the β€œfind a device by its hardware address” girlie. πŸ’…


✨ SYNOPSIS ✨

struct net_device * dev_getbyhwaddr_rcu (struct net *net , unsigned short type , const char *ha );

πŸ’– ARGUMENTS πŸ’–

  • net β€” the applicable net namespace.
  • type β€” media type of device.
  • ha β€” hardware address.

πŸ¦‹ DESCRIPTION πŸ¦‹

So the whole vibe is: search for an interface by MAC address. If the device is not found, it returns NULL; otherwise you get a pointer to the device. Simple enough, right? 🫢

⚠️ But listen, bestie β€” the caller must hold RCU. And the returned device has not had its ref count increased, so the caller must therefore be careful about locking. This is not a β€œgrab it and run” situation, okay? It’s giving β€œborrowed pointer, handle with care.” 😭

🌈 SEE ALSO 🌈

Kernel file: ./net/core/dev.c β€” and here’s the whole extended friend group, no cap:


signed, sealed, and delivered from ./net/core, dated October 2026 β€” periodt, bestie πŸ’‹πŸ’–

πŸ“¦ where this page comes from