dev_uc_sync(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– dev_uc_sync β€” the kernel API manual, bestie edition πŸ’–

Okay so real talk, this page lives in the Kernel API Manual (section 9, kernel girlies rise 🧚), and it's all about one little function that keeps a device's unicast list in sync with another device. Let's get into it ✨


✨ NAME ✨

dev_uc_sync β€” sync up a device's unicast list to another device. Literally copy-the-vibes-but-for-addresses πŸ’…


🌸 SYNOPSIS 🌸

int dev_uc_sync (struct net_device *to , struct net_device *from );

Yes bestie, it takes two devices and returns an int. That's the whole mood πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • to β€” the destination device, aka where the addresses are going πŸ‘‘
  • from β€” the source device, aka where the addresses are coming from πŸ“

πŸ’œ DESCRIPTION πŸ’œ

So here's the tea β˜•: this function adds the newly added addresses over to the destination device, and it releases the addresses that have no users left. Cleanup era fr fr 🧹✨

⚠️ Okay important: the source device must be locked by netif_addr_lock_bh. Not optional, not "eh maybe", it's a must. Don't skip the lock bestie πŸ˜­πŸ”’

This function is intended to be called from the dev->set_rx_mode function of layered software devices. That's its whole main character moment 🌈

And it also assumes that addresses will only ever be synced to the to devices and no other. No side-quests, no sneaky extra devices β€” just to. Periodt πŸ’€


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./net/core/dev_addr_lists.c β€” and the whole friend group 🫢:


And that's the whole page! Sourced from ./net/core, dated October 2026 β€” screenshot it, cite it, cite me, whatever πŸ’…πŸ“Έ mwah, go sync those unicast lists responsibly πŸŽ€πŸ’–

πŸ“¦ where this page comes from