summaryrefslogtreecommitdiff
path: root/meta-google
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2022-07-20 22:35:50 +0300
committerWilliam A. Kennington III <wak@google.com>2022-07-21 05:45:25 +0300
commitfc8c436c9e355982d9f875cffc92a932d5141431 (patch)
tree23c389cdf608818a5206b620714612ce436f2889 /meta-google
parent0817918dd6931a71fa89dafc84c43007d1fa18cd (diff)
downloadopenbmc-fc8c436c9e355982d9f875cffc92a932d5141431.tar.xz
meta-google: network-sh: Fix eui64
Re-read the spec and realized the bit being used was off by 1. Change-Id: I02d0e747f5e47cfbf3a8c4f4b9e45d16a6f8c8b1 Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google')
-rw-r--r--meta-google/recipes-google/networking/network-sh/lib.sh4
-rwxr-xr-xmeta-google/recipes-google/networking/network-sh/test.sh2
2 files changed, 3 insertions, 3 deletions
diff --git a/meta-google/recipes-google/networking/network-sh/lib.sh b/meta-google/recipes-google/networking/network-sh/lib.sh
index b5d9382fcb..e4acc673b8 100644
--- a/meta-google/recipes-google/networking/network-sh/lib.sh
+++ b/meta-google/recipes-google/networking/network-sh/lib.sh
@@ -45,10 +45,10 @@ mac_to_eui64() {
mac_to_bytes mac_bytes "$1" || return
# Using EUI-64 conversion rules, create the suffix bytes from MAC bytes
- # Invert bit-0 of the first byte, and insert 0xfffe in the middle.
+ # Invert bit-1 of the first byte, and insert 0xfffe in the middle.
local suffix_bytes=(
0 0 0 0 0 0 0 0
- $((mac_bytes[0] ^ 1))
+ $((mac_bytes[0] ^ 2))
${mac_bytes[@]:1:2}
$((0xff)) $((0xfe))
${mac_bytes[@]:3:3}
diff --git a/meta-google/recipes-google/networking/network-sh/test.sh b/meta-google/recipes-google/networking/network-sh/test.sh
index 2803c09785..9596eef3e0 100755
--- a/meta-google/recipes-google/networking/network-sh/test.sh
+++ b/meta-google/recipes-google/networking/network-sh/test.sh
@@ -57,7 +57,7 @@ test_mac_to_eui48() {
test_mac_to_eui64() {
str="$(mac_to_eui64 '12:34:56:78:90:af')" || fail
- expect_streq "$str" '::1334:56ff:fe78:90af'
+ expect_streq "$str" '::1034:56ff:fe78:90af'
}
test_ip4_to_bytes() {