__batadv_get_real_netdev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ __batadv_get_real_netdev(9) β€” a Kernel API Manual moment πŸ’…

okay so bestie, welcome to the kernel API manual, the vibes edition ✨ this one lives in Kernel API Manual land and it's all about peeking behind the curtain of a netdev struct πŸŽ€


✨ NAME ✨

__batadv_get_real_netdev β€” lowkey checks whether the netdev struct you handed it is actually a virtual interface sitting on top of another, more "real" interface 🫢 like is it the main character or just a costume, y'know?


🌸 SYNOPSIS 🌸

struct net_device * __batadv_get_real_netdev (struct net_device *netdev);

πŸŽ€ ARGUMENTS πŸŽ€

  • netdev β€” the device you're checking πŸ‘€ the one on trial, the one getting the vibe check.

πŸ’– DESCRIPTION πŸ’–

okay so heads up, this is the important part: callers must hold the rtnl semaphore. no cap, you literally have to hold it before you call this. πŸ”’

and also, like... you may want batadv_get_real_netdev instead of this one πŸ™ˆ this is the underscore-prefixed version, the "you'd better know what you're doing" version. iykyk.


πŸ¦‹ RETURN πŸ¦‹

it hands back the 'real' net device, or the original net device β€” and NULL in case of an error 😭 so yeah, always check your pointers, bestie, periodt.


⭐ SEE ALSO ⭐

Kernel file ./net/batman-adv/hard-interface.c β€” go read it, it ate πŸ’…

the whole friend group, in order:


🫢 reminder bestie: hold that rtnl semaphore. that's not a suggestion, that's a lifestyle. πŸ”₯

and that's the whole page, mwah πŸ’‹

okay so source-wise this all comes from ./net/batman-adv, dated October 2026, and the page is literally called __batadv_get_real_netdev(9) β€” that's the sign-off, go off queen πŸ‘‘βœ¨

πŸ“¦ where this page comes from