diff options
author | William A. Kennington III <wak@google.com> | 2021-04-27 00:10:52 +0300 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2021-05-07 04:09:53 +0300 |
commit | 24615567082edbe4c287e994f92fb94afcedf185 (patch) | |
tree | de261a0bf0e121f174745518e35497b634ef1582 /meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ensure-ra.sh | |
parent | 5ba6d08d7f49d26ae466f6d826ed1d849972ad59 (diff) | |
download | openbmc-24615567082edbe4c287e994f92fb94afcedf185.tar.xz |
meta-google: gbmc-bridge: Assign stable addresses from RAs
We want BMCs to be able to discover their machine prefix and assign a
stable IPv6 based on that prefix combined with the MAC of the BMC.
Change-Id: I67b8c56f50ff3a970175abcb81b429ceb1258b69
Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ensure-ra.sh')
-rw-r--r-- | meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ensure-ra.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ensure-ra.sh b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ensure-ra.sh new file mode 100644 index 000000000..60e33d89b --- /dev/null +++ b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ensure-ra.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Every 30 seconds, send out an RA so that the kernel will receive a response. +# This ensures that all BMCs (even ones that think they are routers) get updated +# information from the other systems on the network. +w=30 +while true; do + start=$SECONDS + rdisc6 -m gbmcbr -r 1 -w $(( w * 1000 )) >/dev/null 2>/dev/null + # If rdisc6 exits early we still want to wait the full `w` time before + # starting again. + (( timeout = start + w - SECONDS )) + sleep $(( timeout < 0 ? 0 : timeout )) +done |