diff options
Diffstat (limited to 'meta-google/recipes-google/networking')
5 files changed, 32 insertions, 9 deletions
diff --git a/meta-google/recipes-google/networking/files/gbmc-ip-monitor.sh b/meta-google/recipes-google/networking/files/gbmc-ip-monitor.sh index e64c8675e..9da090f47 100755 --- a/meta-google/recipes-google/networking/files/gbmc-ip-monitor.sh +++ b/meta-google/recipes-google/networking/files/gbmc-ip-monitor.sh @@ -44,6 +44,17 @@ gbmc_ip_monitor_generate_init() { echo '[INIT]' } +GBMC_IP_MONITOR_DEFER_OUTSTANDING= +gbmc_ip_monitor_defer_() { + sleep 1 + printf '[DEFER]\n' >&$GBMC_IP_MONITOR_DEFER +} +gbmc_ip_monitor_defer() { + [ -z "$GBMC_IP_MONITOR_DEFER_OUTSTANDING" ] || return 0 + gbmc_ip_monitor_defer_ & + GBMC_IP_MONITOR_DEFER_OUTSTANDING=1 +} + gbmc_ip_monitor_parse_line() { local line="$1" if [[ "$line" == '[INIT]'* ]]; then @@ -98,11 +109,16 @@ gbmc_ip_monitor_parse_line() { read line || break data=($line) mac="${data[1]}" + elif [[ "$line" == '[DEFER]'* ]]; then + GBMC_IP_MONITOR_DEFER_OUTSTANDING= + change=defer else return 2 fi } +return 0 2>/dev/null + cleanup() { local st="$?" trap - HUP INT QUIT ABRT TERM EXIT @@ -111,7 +127,10 @@ cleanup() { } trap cleanup HUP INT QUIT ABRT TERM EXIT -return 0 2>/dev/null +FIFODIR="$(mktemp -d)" +mkfifo "$FIFODIR"/fifo +exec {GBMC_IP_MONITOR_DEFER}<>"$FIFODIR"/fifo +rm -rf "$FIFODIR" while read line; do gbmc_ip_monitor_parse_line "$line" || continue @@ -119,4 +138,4 @@ while read line; do if [ "$change" = 'init' ]; then systemd-notify --ready fi -done < <(gbmc_ip_monitor_generate_init; exec ip monitor link addr route label) +done < <(gbmc_ip_monitor_generate_init; ip monitor link addr route label & cat <&$GBMC_IP_MONITOR_DEFER) diff --git a/meta-google/recipes-google/networking/files/gbmc-mac-config.sh.in b/meta-google/recipes-google/networking/files/gbmc-mac-config.sh.in index a3430a65e..fa2f4bffe 100644 --- a/meta-google/recipes-google/networking/files/gbmc-mac-config.sh.in +++ b/meta-google/recipes-google/networking/files/gbmc-mac-config.sh.in @@ -15,7 +15,7 @@ source /usr/share/ipmi-fru/lib.sh || exit -eeprom="$(of_name_to_eeprom '@EEPROM@')" || exit +ipmi_fru_alloc '@EEPROM@' eeprom || exit header=() read_header "$eeprom" header || exit diff --git a/meta-google/recipes-google/networking/gbmc-bridge/-bmc-gbmcbr.network.in b/meta-google/recipes-google/networking/gbmc-bridge/-bmc-gbmcbr.network.in index c6097bbdb..afea5cca7 100644 --- a/meta-google/recipes-google/networking/gbmc-bridge/-bmc-gbmcbr.network.in +++ b/meta-google/recipes-google/networking/gbmc-bridge/-bmc-gbmcbr.network.in @@ -7,3 +7,5 @@ IPv6AcceptRA=true LLMNR=true MulticastDNS=true LinkLocalAddressing=ipv6 +[IPv6AcceptRA] +DHCPv6Client=false diff --git a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-from-ra.sh b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-from-ra.sh index 18341fefb..a9bfd74af 100644 --- a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-from-ra.sh +++ b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-from-ra.sh @@ -67,26 +67,28 @@ gbmc_br_from_ra_update() { gbmc_br_from_ra_hook() { if [ "$change" = 'init' ]; then gbmc_br_from_ra_init=1 + gbmc_ip_monitor_defer + elif [ "$change" = 'defer' ]; then gbmc_br_from_ra_update elif [[ "$change" == 'route' && "$route" != *' via '* ]] && [[ "$route" =~ ^(.* dev gbmcbr proto ra .*)( +expires +([^ ]+)sec).*$ ]]; then pfx="${route%% *}" if [ "$action" = 'add' ]; then gbmc_br_from_ra_pfxs["$pfx"]="${BASH_REMATCH[3]}" - gbmc_br_from_ra_update + gbmc_ip_monitor_defer elif [ "$action" = 'del' ]; then gbmc_br_from_ra_pfxs["$pfx"]=0 - gbmc_br_from_ra_update + gbmc_ip_monitor_defer fi elif [ "$change" = 'link' -a "$intf" = 'gbmcbr' ]; then rdisc6 -m gbmcbr -r 1 -w 100 >/dev/null 2>&1 if [ "$action" = 'add' -a "$mac" != "$gbmc_br_from_ra_mac" ]; then gbmc_br_from_ra_mac="$mac" - gbmc_br_from_ra_update + gbmc_ip_monitor_defer fi if [ "$action" = 'del' -a "$mac" = "$gbmc_br_from_ra_mac" ]; then gbmc_br_from_ra_mac= - gbmc_br_from_ra_update + gbmc_ip_monitor_defer fi fi } diff --git a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-nft.sh b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-nft.sh index 19b8f64a1..980f7b6d6 100644 --- a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-nft.sh +++ b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-nft.sh @@ -48,7 +48,7 @@ gbmc_br_nft_hook() { gbmc_br_nft_update # Match only global IP addresses on the bridge that match the BMC prefix # (<mpfx>:fdxx:). So 2002:af4:3480:2248:fd02:6345:3069:9186 would become - # a 2002:af4:3480:2248:fd00/72 rule. + # a 2002:af4:3480:2248:fd00/76 rule. elif [ "$change" = 'addr' -a "$intf" = 'gbmcbr' -a "$scope" = 'global' ] && [[ "$fam" == 'inet6' && "$flags" != *tentative* ]]; then local ip_bytes=() @@ -63,7 +63,7 @@ gbmc_br_nft_hook() { for (( i=9; i<16; i++ )); do ip_bytes[$i]=0 done - pfx="$(ip_bytes_to_str ip_bytes)/72" + pfx="$(ip_bytes_to_str ip_bytes)/76" if [ "$action" = "add" -a "$pfx" != "$gbmc_br_nft_pfx" ]; then gbmc_br_nft_pfx="$pfx" gbmc_br_nft_update |