diff options
author | Rob Landley <rob@landley.net> | 2016-01-16 16:59:47 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2016-01-16 16:59:47 -0600 |
commit | 5493916370c74944cc796cc91d058fb4ccabe140 (patch) | |
tree | ce6a45d351c227c0c14083d5f48ae1e8ed919589 /toys | |
parent | 7279b849f48e2ceb1d35e82e53b14343b708d776 (diff) | |
download | toybox-5493916370c74944cc796cc91d058fb4ccabe140.tar.gz |
Move create_uuid() to lib and xpoll() to lib/net.c.
Diffstat (limited to 'toys')
-rw-r--r-- | toys/pending/mke2fs.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/toys/pending/mke2fs.c b/toys/pending/mke2fs.c index a2c15291..b4c841ad 100644 --- a/toys/pending/mke2fs.c +++ b/toys/pending/mke2fs.c @@ -219,31 +219,6 @@ static void check_treelinks(struct dirtree *tree) } } -// According to http://www.opengroup.org/onlinepubs/9629399/apdxa.htm -// we should generate a uuid structure by reading a clock with 100 nanosecond -// precision, normalizing it to the start of the gregorian calendar in 1582, -// and looking up our eth0 mac address. -// -// On the other hand, we have 128 bits to come up with a unique identifier, of -// which 6 have a defined value. /dev/urandom it is. - -static void create_uuid(char *uuid) -{ - // Read 128 random bits - int fd = xopen("/dev/urandom", O_RDONLY); - xreadall(fd, uuid, 16); - close(fd); - - // Claim to be a DCE format UUID. - uuid[6] = (uuid[6] & 0x0F) | 0x40; - uuid[8] = (uuid[8] & 0x3F) | 0x80; - - // rfc2518 section 6.4.1 suggests if we're not using a macaddr, we should - // set bit 1 of the node ID, which is the mac multicast bit. This means we - // should never collide with anybody actually using a macaddr. - uuid[11] = uuid[11] | 128; -} - // Calculate inodes per group from total inodes. static uint32_t get_inodespg(uint32_t inodes) { |