summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-04-06 19:41:53 +0100
committerLeah Rowe <leah@libreboot.org>2023-04-06 19:41:53 +0100
commit9372ae3ddcb63377b1ab0b77e4db4086deef3244 (patch)
treefdc8eb34955cfb5649d80f76a282885ebcfb09ca /util/nvmutil
parentd3ad50dcb48a104031f6cfdf022f787c3a58ec42 (diff)
util/nvmutil: one more comment
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index b77b28ad..a58f66a1 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -225,9 +225,10 @@ parseMacAddress(const char *strMac, uint16_t *mac)
for (int nib = 0; nib < 2; nib++, total += h) {
if ((h = hextonum(strMac[i + nib])) > 15)
return -1;
+ /* ensure local, unicast mac address if random: */
if ((byte == 0) && (nib == 1))
if (strMac[i + nib] == '?')
- h = (h & 0xE) | 2;
+ h = (h & 0xE) | 2; /* local, unicast */
mac[byte >> 1] |= ((uint16_t ) h)
<< ((8 * ((byte % 2) ^ 1)) + (4 * (nib ^ 1)));
}