dev_set_mac_address(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ dev_set_mac_address(9) πŸ‘‘

okay so bestie, welcome to dev_set_mac_address(9) from the Kernel API Manual β€” we're in kernel API territory and this page is literally all about changing a device's Media Access Control Address, aka the MAC address πŸ’…βœ¨


🌸 NAME 🌸

dev_set_mac_address β€” change Media Access Control Address


✨ SYNOPSIS ✨

no cap, here's the whole signature exactly as it is:

int dev_set_mac_address (struct net_device *dev , struct
       sockaddr_storage *ss , struct netlink_ext_ack *extack );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” device. the device you're working with, bestie 🫢
  • ss β€” new address. the new address, periodt ✨
  • extack β€” netlink extended ack. the netlink extended ack, iykyk πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

Change the hardware (MAC) address of the device. that's the whole vibe β€” it changes the hardware (MAC) address of the device 🌈


πŸ’œ RETURN πŸ’œ

  • 0 on success πŸŽ‰
  • -errno on failure 😭

🌈 SEE ALSO 🌈

Kernel file: ./net/core/dev_api.c β€” and these are the SEE ALSO besties, all accounted for:


xoxo from the Kernel API Manual, source ./net/core, dated October 2026 β€” dev_set_mac_address(9) signing off πŸ’–πŸ«Άβœ¨

πŸ“¦ where this page comes from