dev_close(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dev_close(9) β€” Kernel API Manual, bestie edition

Ok so real talk, this one lives in the Kernel API Manual and it's called dev_close(9). It's short, it's sweet, it's giving "one job, does it well." Let's get into it πŸŽ€


✨ NAME ✨

dev_close β€” shutdown an interface πŸ”Œ

Like, the polite way to put your network device to bed. Nap time, no cap 😴


πŸ¦‹ SYNOPSIS πŸ¦‹

void dev_close (struct net_device *dev );

One argument. One function. Zero drama. Slay πŸ’…


🌸 ARGUMENTS 🌸

  • dev β€” the device to shutdown. That's it, that's the whole argument. It's the struct net_device * you're putting down 😭

πŸ”₯ DESCRIPTION πŸ”₯

Okay so here's the whole vibe: this function moves an active device into the down state. Literally taking it from "we're so on" to "we're so off" ✨

The order of operations is important, so pay attention bestie:

  1. A NETDEV_GOING_DOWN is sent to the netdev notifier chain β€” like a little group chat announcement, "hey everyone, it's about to go down" πŸ“’
  2. The device is then deactivated.
  3. Finally a NETDEV_DOWN is sent to the notifier chain β€” "okay it's officially down, periodt" πŸ’€

That's genuinely the whole thing. Two notifier events sandwiching the deactivation, in that exact order. Iconic behaviour honestly πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

Kernel file ./net/core/dev_api.c β€” and like, all of these siblings:

(If dev_close is the "goodnight", dev_open(9) is the "gm bestie β˜€οΈ" β€” they're a matched set, iykyk.)


🫢 And that's the page! This lil gem comes from ./net/core, dated October 2026, and it's dev_close(9) β€” go forth and shut things down responsibly, mwah πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from