FreeBSD/sys/dev/rt/if_rt.c
/*
 * generate_mac(uin8_t *mac)
 * This is MAC address generator for cases when real device MAC address
 * unknown or not yet accessible.
 * Use 'b','s','d' signature and 3 octets from CRC32 on kenv.
 * MAC = 'b', 's', 'd', CRC[3]^CRC[2], CRC[1], CRC[0]
 *
 * Output - MAC address, that do not change between reboots, if hints or
 * bootloader info unchange.
 */
generate_mac(uin8_t *mac)
This is MAC address generator for cases when real device MAC address
unknown or not yet accessible.

MAC address, that do not change between reboots, if hints or
bootloader info unchange.
generate_mac ( uin8_t * mac ) This is MAC address generator for cases when real device MAC address unknown or not yet accessible . MAC address that do not change between reboots if hints or bootloader info unchange .
static void
generate_mac(uint8_t *mac)
{
	unsigned char *cp;
	int i = 0;
	uint32_t crc = 0xffffffff;
	for (cp = kenvp[0]; cp != NULL; cp = kenvp[++i]) {
		crc = calculate_crc32c(crc, cp, strlen(cp) + 1);
	}
	crc = ~crc;
	mac[0] = 'b';
	mac[1] = 's';
	mac[2] = 'd';
	mac[3] = (crc >> 24) ^ ((crc >> 16) & 0xff);
	mac[4] = (crc >> 8) & 0xff;
	mac[5] = crc & 0xff;
}
static void generate_mac ( uint8_t * mac ) { unsigned char * cp ; int i = 0 ; uint32_t crc = 0xffffffff ; for ( cp = kenvp [ 0 ] ; cp != NULL ; cp = kenvp [ ++ i ] ) { crc = calculate_crc32c ( crc , cp , strlen ( cp ) + 1 ) ; } crc = ~ crc ; mac [ 0 ] = ' ' ; mac [ 1 ] = ' ' ; mac [ 2 ] = ' ' ; mac [ 3 ] = ( crc >> 24 ) ^ ( ( crc >> 16 ) & 0xff ) ; mac [ 4 ] = ( crc >> 8 ) & 0xff ; mac [ 5 ] = crc & 0xff ; }
generate_mac(uin8_t *mac)
 This is MAC address generator for cases when real device MAC address
 unknown or not yet accessible.
generate_mac ( uin8_t * mac ) This is MAC address generator for cases when real device MAC address unknown or not yet accessible .
/* Generate CRC32 on kenv */