dev_change_flags(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dev_change_flags(9) β€” or, how to glow-up your netdev's settings ✨

okay bestie, so this one lives in the Kernel API Manual, and it's genuinely iconic β€” it's the function that lets you flip a network device's state flags. no cap, it's giving "remote control for your NIC" energy πŸŽ€


🌸 SYNOPSIS 🌸

int dev_change_flags (struct net_device *dev , unsigned int flags ,
       struct netlink_ext_ack *extack );

like, three args, one int back. simple. clean. slay πŸ’…


🫢 ARGUMENTS 🫢

  • dev β€” the device. the actual network device you're messing with, a struct net_device *. yes, that one. πŸ‘‘
  • flags β€” the device state flags. this is the whole vibe check of the call β€” the flags you want to set. πŸ¦‹
  • extack β€” netlink extended ack. the little receipt-machine for netlink errors, a struct netlink_ext_ack *. πŸ“¬

πŸ’– DESCRIPTION πŸ’–

so what does it do? it changes settings on the device based on the state flags you pass in. literally that's the whole thing. 🧚

and here's the little detail that matters β€” the flags are in the userspace exported format. so like, the same flag layout the userspace side sees. not some secret kernel-only dialect. iykyk πŸ”₯


⭐ RETURN ⭐

  • 0 on success β€” we love a clean win πŸ’š
  • -errno on failure β€” classic kernel move, negative errno, no surprises 😭

🌈 SEE ALSO 🌈

okay this list is long and honestly kind of a flex. all of these live in the kernel file ./net/core/dev_api.c, and they're all the sibling functions doing adjacent little jobs:

no cap bestie, if you're touching flags you're probably also touching at least three of these. the netdev API is a whole ecosystem and you're just living in it πŸ¦‹

and that's the whole page!! written from the kernel source tree at ./net/core, dated October 2026, and archived under the manual name dev_change_flags(9) β€” mwah, go flip some flags πŸ’œβœ¨

πŸ“¦ where this page comes from