From 10dc43a1a276869d0500fcf7c081ac6e914b1182 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Tue, 10 May 2022 10:30:25 -0700 Subject: meta-google: gbmc-ncsi-config: Allow BMC address assignment We need to allow BMC address assignment so that we can deprecate the impersonation assignment we are currently performing on the BMC. Change-Id: Ia153d0a5692876ef2c36b71230d597e51904d467 Signed-off-by: William A. Kennington III --- .../ncsi/files/gbmc-ncsi-br-pub-addr.sh.in | 27 ++++++++++++++-------- .../recipes-google/ncsi/files/gbmc-ncsi-nft.sh.in | 7 ++++++ 2 files changed, 25 insertions(+), 9 deletions(-) (limited to 'meta-google') diff --git a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in index 793403348e..9f008a9a44 100644 --- a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in +++ b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in @@ -29,21 +29,30 @@ gbmc_ncsi_br_pub_addr_update() { local pfx_bytes=() if [ -n "$gbmc_ncsi_br_pub_addr_lastip" ]; then ip_to_bytes pfx_bytes "$gbmc_ncsi_br_pub_addr_lastip" - # Ensure we don't have more than a /64 address - local i - for (( i = 8; i < 16; ++i )); do - if (( pfx_bytes[$i] != 0 )); then - pfx_bytes=() - break - fi - done + # Ensure we have a /64 or an fdxx address + if (( pfx_bytes[8] != 0xfd || pfx_bytes[9] == 0 )); then + local i + for (( i = 8; i < 16; ++i )); do + if (( pfx_bytes[$i] != 0 )); then + pfx_bytes=() + break + fi + done + fi fi local contents= if (( ${#pfx_bytes[@]} != 0 )); then pfx_bytes[8]=0xfd + # Save our old prefix assuming we have one + local old_offset="${pfx_bytes[9]}" + if (( old_offset == 0 )); then + old_offset=0x01 + else + pfx_bytes[9]=0x00 + fi local stateless_pfx="$(ip_bytes_to_str pfx_bytes)" - pfx_bytes[9]=0x01 + pfx_bytes[9]="$old_offset" local ncsi_pfx="$(ip_bytes_to_str pfx_bytes)" read -r -d '' contents <