dev_index_reserve(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so bestie, this is dev_index_reserve(9) from the Kernel API Manual, and it’s giving β€œreserve me an ifindex in a namespace” energy ✨

  • dev_index_reserve β€” allocate an ifindex in a namespace πŸ’…

πŸŽ€ SYNOPSIS πŸŽ€

int dev_index_reserve (struct net *net , u32 ifindex );

πŸ’… ARGUMENTS πŸ’…

  • net β€” the applicable net namespace 🫢
  • ifindex β€” requested ifindex; pass 0 to get one allocated ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the whole point: allocate an ifindex for a new device. The caller must either use that ifindex to store the device (via list_netdevice) or call dev_index_release to give the index up. That’s the rule, no cap πŸ’–


⭐ RETURN ⭐

a suitable unique value for a new device interface number or -errno πŸ‘‘


🌈 SEE ALSO 🌈

Kernel file ./net/core/dev.c plus the whole friend group:


mwah πŸ’‹ this page’s source is ./net/core, dated October 2026, and it’s the dev_index_reserve(9) page β€” slay and goodbye 🫢

πŸ“¦ where this page comes from