netdev_has_upper_dev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌟 netdev_has_upper_dev(9) β€” Kernel API Manual 🌟

okay so bestie, this page is from the Kernel API Manual, and it is literally a tiny β€œare these two netdevs linked?” check. Lowkey simple, highkey needs the right lock. Let’s go πŸ’…

πŸŽ€ NAME πŸŽ€

netdev_has_upper_dev β€” check if device is linked to an upper device.

✨ SYNOPSIS ✨

bool netdev_has_upper_dev (struct net_device *dev , struct net_device
       *upper_dev );

🫢 ARGUMENTS 🫢

  • dev β€” device. The one we’re looking at πŸ‘€
  • upper_dev β€” upper device to check. The one we’re checking for πŸ”

πŸ’– DESCRIPTION πŸ’–

Okay so here’s the tea: find out if a device is linked to specified upper device and return true in case it is. Note that this checks only immediate upper device, not through a complete stack of devices. The caller must hold the RTNL lock. Periodt.

Don’t go walking the whole stack with this one β€” it’s strictly immediate, no cap. And fr fr, hold the RTNL lock before calling, or you’re gonna have a bad time 😭.

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./net/core/dev.c β€” plus the whole squad:


okay bye bestie 🫢 this page is from ./net/core, dated October 2026, and it’s all about netdev_has_upper_dev(9) πŸ’–

πŸ“¦ where this page comes from