diff options
author | rse <rse@13f79535-47bb-0310-9956-ffa450edef68> | 2004-01-23 08:49:52 +0000 |
---|---|---|
committer | rse <rse@13f79535-47bb-0310-9956-ffa450edef68> | 2004-01-23 08:49:52 +0000 |
commit | c4044115b6b4088ea72d0329a3c6d38ffc21c3c2 (patch) | |
tree | f42a2f948992b2b6671c6e64ab77576b9d9b4098 /crypto | |
parent | 6578111f219d4772017c4aea78c63dd883aafeef (diff) | |
download | libapr-util-c4044115b6b4088ea72d0329a3c6d38ffc21c3c2.tar.gz |
Fix generation of random multicast MAC address.
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
this 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).
git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@58972 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/getuuid.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/getuuid.c b/crypto/getuuid.c index 01249b06..40e453b0 100644 --- a/crypto/getuuid.c +++ b/crypto/getuuid.c @@ -140,7 +140,7 @@ static void get_random_info(unsigned char node[NODE_LENGTH]) static void get_pseudo_node_identifier(unsigned char *node) { get_random_info(node); - node[0] |= 0x80; /* this designates a random node ID */ + node[0] |= 0x01; /* this designates a random node ID */ } static void get_system_time(apr_uint64_t *uuid_time) |