Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/etherdevice.h
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | |||||
eth_zero_addr(u8 *pa) | eth_zero_addr(u8 *pa) | ||||
{ | { | ||||
memset(pa, 0, 6); | memset(pa, 0, 6); | ||||
} | } | ||||
static inline void | static inline void | ||||
random_ether_addr(u8 * dst) | random_ether_addr(u8 * dst) | ||||
{ | { | ||||
if (read_random(dst, 6) == 0) | arc4random_buf(dst, 6); | ||||
arc4rand(dst, 6, 0); | |||||
dst[0] &= 0xfe; | dst[0] &= 0xfe; | ||||
dst[0] |= 0x02; | dst[0] |= 0x02; | ||||
} | } | ||||
#endif /* _LINUX_ETHERDEVICE */ | #endif /* _LINUX_ETHERDEVICE */ |