dev_change_net_namespace(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dev_change_net_namespace(9)

okay so this is a page from the Kernel API Manual, and it's about dev_change_net_namespace β€” the little icon that relocates a whole network device into a different nethost namespace. bestie, it's giving "moving out of your group chat into a new one" energy πŸ¦‹


✨ NAME ✨

dev_change_net_namespace β€” move device to different nethost namespace

🌸 SYNOPSIS 🌸

int dev_change_net_namespace (struct net_device *dev , struct net *net ,
const char *pat );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device. the main character we're relocating πŸ’…
  • net β€” the network namespace. this is where it's moving to, new address new vibe ✨
  • pat β€” if this is not NULL, it's a name pattern to try when the current device name is already taken in the destination network namespace. like, "oof that handle's taken, let's try this variant" πŸ™ˆ

πŸ”₯ DESCRIPTION πŸ”₯

so what it does: this function shuts down a device interface and moves it to a new network namespace. that's the whole plot. on success 0 is returned, and on a failure a negative errno code is returned. no cap πŸ“‰

⚠️ callers must hold the rtnl semaphore. like, this is not optional, the lock is the vibe check and you WILL fail it if you skip it πŸ’€

⭐ RETURN ⭐

0 on success, -errno on failure. that's it, that's the whole return section 🫢

🌈 SEE ALSO 🌈

kernel file ./net/core/dev_api.c β€” and honestly the whole friend group:


and that's the page!! πŸ’– it lives in ./net/core, dated October 2026, and it's signed off as dev_change_net_namespace(9) β€” go forth and namespace responsibly, bestie πŸ‘‘πŸŽ€

πŸ“¦ where this page comes from