dev_change_flags(9)
π 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, astruct 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, astruct 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 β
0on success β we love a clean win π-errnoon 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:
dev_change_name(9)β rename arc πdev_set_alias(9)β the nickname eradev_set_group(9)β group assignment, very "which friend group are you in"dev_change_net_namespace(9)β moving to a whole different namespace, main character energydev_change_carrier(9)β carrier signal shenanigansdev_change_tx_queue_len(9)β queue length glow-updev_change_proto_down(9)β protocol down statedev_open(9)β bring it updev_close(9)β bring it downdev_disable_lro(9)β LRO off, bye πdev_set_promiscuity(9)β the promiscuous counter, no judgementdev_set_allmulti(9)β allmulti counterdev_set_mac_address(9)β new MAC, new me πnetdev_state_change(9)β announce that state changed, fr fr
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms