Changeset 8e7c9fe in mainline for uspace/lib/gpt/libgpt.c
- Timestamp:
- 2014-09-12T03:45:25Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c53b58e
- Parents:
- 3eb0c85 (diff), 105d8d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gpt/libgpt.c
r3eb0c85 r8e7c9fe 707 707 } 708 708 709 /** Generate a new pseudo-random UUID 710 * 711 * FIXME: This UUID generator is not compliant with RFC 4122. 712 * 713 */ 709 /** Generate a new pseudo-random UUID compliant with RFC 4122 */ 714 710 void gpt_set_random_uuid(uint8_t *uuid) 715 711 { … … 718 714 for (size_t i = 0; i < 16; i++) 719 715 uuid[i] = random(); 716 717 /* 718 * Set version (stored in bits 4-7 of seventh byte) to 4 (random 719 * UUID) and bits 6 and 7 of ninth byte to 0 and 1 respectively - 720 * according to RFC 4122, section 4.4. 721 */ 722 uuid[6] &= 0x0f; 723 uuid[6] |= (0x4 << 4); 724 uuid[8] &= 0x3f; 725 uuid[8] |= (1 << 7); 720 726 } 721 727
Note:
See TracChangeset
for help on using the changeset viewer.