dev_addr_add(9)
π dev_addr_add(9) π
okay so bestie, welcome to the Kernel API Manual β this is the dev_addr_add page and honestly it's giving "small function, big responsibilities" β¨
πΈ NAME πΈ
dev_addr_add β add a device address π
β¨ SYNOPSIS β¨
int dev_addr_add (struct net_device *dev , const unsigned char *addr ,
unsigned char addr_type );
like, that's the whole vibe. she returns an int, she takes three things, she's booked and busy π
π¦ ARGUMENTS π¦
devβ the device, bestie. the actualstruct net_devicewe're messing with π«Άaddrβ the address to add. like, the address. the one we're adding. πaddr_typeβ the address type. it's anunsigned charand it's very much doing its own thing π
π DESCRIPTION π
So here's the tea: dev_addr_add adds a device address to the device or β and this is the iconic part β increases the reference count if it already exists. so like, no duplicates, no drama, just a lil refcount glow-up when she's already there π
β οΈ ok but fr fr, the caller must hold the rtnl_mutex. that's not a suggestion, that's a requirement. no cap. hold the lock or don't come to the function π
β SEE ALSO β
the full friend group, in order, no one left out π«Ά:
- Kernel file
./net/core/dev_addr_lists.c __hw_addr_sync_dev(9)__hw_addr_ref_sync_dev(9)__hw_addr_ref_unsync_dev(9)__hw_addr_unsync_dev(9)__hw_addr_list_snapshot(9)__hw_addr_list_reconcile(9)dev_addr_flush(9)dev_addr_init(9)dev_addr_del(9)dev_uc_add_excl(9)dev_uc_add(9)dev_uc_del(9)dev_uc_sync(9)dev_uc_sync_multiple(9)dev_uc_unsync(9)dev_uc_flush(9)dev_uc_init(9)dev_mc_add_excl(9)dev_mc_add(9)dev_mc_add_global(9)dev_mc_del(9)dev_mc_del_global(9)dev_mc_sync(9)dev_mc_sync_multiple(9)dev_mc_unsync(9)dev_mc_flush(9)dev_mc_init(9)netif_uc_promisc_update(9)__dev_set_rx_mode(9)netif_rx_mode_sync(9)
π sign-off π
and that's the page, bestie!! this iconic little number lives in ./net/core, dated October 2026, and yes she's literally named dev_addr_add(9) β go forth and add those addresses, but hold that rtnl_mutex first ππ
you're gonna slay this kernel work fr fr π§ββοΈ
π¦ 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