---
name: "dev_hw_addr_random"
section: "9"
platform: "linux"
package: "linux-manual-3.2"
version: "3.2.78-1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/dev_hw_addr_random"
---

# dev\_hw\_addr\_random(9)

Create random MAC and set device flag

## NAME

dev\_hw\_addr\_random - Create random MAC and set device flag

## SYNOPSIS

**void dev\_hw\_addr\_random(struct net\_device \*** *dev***, u8 \*** *hwaddr***);**

## ARGUMENTS

*dev*

pointer to net\_device structure

*hwaddr*

Pointer to a six-byte array containing the Ethernet address

## DESCRIPTION

Generate random MAC to be used by a device and set addr\_assign\_type so the state can be read by sysfs and be used by udev.

## COPYRIGHT
