E&S CVS Commit: PEAK - Fix generation of random multicast MAC address, a'la FreeBSD's

tsarna at eby-sarna.com tsarna at eby-sarna.com
Mon Jan 26 17:13:00 EST 2004


Module Name:	PEAK
Committed By:	tsarna
Date:		Mon Jan 26 22:12:26 UTC 2004

Modified Files:
	PEAK/src/peak/util: nodeid48.py

Log Message:
Fix generation of random multicast MAC address, a'la FreeBSD's
src/sys/kern/kern_uuid.c rev 1.7:

"""In case no real/physical IEEE 802 address is available, both the expired
"draft-leach-uuids-guids-01" (section "4. Node IDs when no IEEE 802
network card is available") and RFC 2518 (section "6.4.1 Node Field
Generation Without the IEEE 802 Address") recommend (quoted from RFC
2518):

  "The ideal solution is to obtain a 47 bit cryptographic quality random
  number, and use it as the low 47 bits of the node ID, with the _most_
  significant bit of the first octet of the node ID set to 1. This bit
  is the unicast/multicast bit, which will never be set in IEEE 802
  addresses obtained from network cards; hence, there can never be a
  conflict between UUIDs generated by machines with and without network
  cards."

Unfortunately, this incorrectly explains how to implement this and
the FreeBSD UUID generator code inherited this generation bug from
the broken reference code in the standards draft. They should instead
specify the "_least_ significant bit of the first octet of the node ID"
as the multicast bit in a memory and hexadecimal string representation
of a 48-bit IEEE 802 MAC address.

This standards bug arised from a false interpretation, as the multicast
bit is actually the _most_ significant bit in IEEE 802.3 (Ethernet)
_transmission order_ of an IEEE 802 MAC address. The standards authors
forgot that the bitwise order of an _octet_ from a MAC address _memory_
and hexadecimal string representation is still always from left (MSB,
bit 7) to right (LSB, bit 0).

Fortunately, this UUID generation bug could have occurred on systems
without any Ethernet NICs only."""

nodeid48 suffered the same bug, for the same reasons, with the same impact.


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PEAK/src/peak/util/nodeid48.py.diff?r1=1.7&r2=1.8

To generate a diff of this commit:
cvs rdiff -r1.7 -r1.8 PEAK/src/peak/util/nodeid48.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




More information about the source-changes mailing list