diff options
author | William A. Kennington III <wak@google.com> | 2024-03-20 03:32:17 +0300 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2024-03-26 00:37:26 +0300 |
commit | aa21bd6cbe54b6c195f044d33f17a180b8f8871f (patch) | |
tree | e60b0180a36cc2ad76a217ece25aeaf134ef4b24 /meta-google | |
parent | fa440e91e05c83223a106db0cad271a8cd965240 (diff) | |
download | openbmc-aa21bd6cbe54b6c195f044d33f17a180b8f8871f.tar.xz |
meta-google: gbmc-ncsi-config: ip-from-ra: Fix rdisc latency
There will be undesirable buffering running rdisc directly from a
subshell, if we run it under `script` we will not suffer from output
buffering and instead immediately receive the printed lines from the RS
packet.
Tested: Verified on a smartnic system to prove that the address is still
set.
Change-Id: I3f340b0c731d5e6969b38008f30b388a5f749866
Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google')
-rwxr-xr-x | meta-google/recipes-google/ncsi/files/gbmc-ncsi-ip-from-ra.sh.in | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-ip-from-ra.sh.in b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-ip-from-ra.sh.in index d0445d3c94..bf1c441d41 100755 --- a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-ip-from-ra.sh.in +++ b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-ip-from-ra.sh.in @@ -60,6 +60,8 @@ w=60 while true; do start=$SECONDS while read -r line; do + # `script` terminates all lines with a CRLF, remove it + line="${line:0:-1}" if [ -z "$line" ]; then hextet= pfx= @@ -87,7 +89,7 @@ while true; do set_net || true set_host || true fi - done < <(rdisc6 -d -m "$NCSI_IF" -w $(( w * 1000 )) 2>/dev/null) + done < <(exec script -q -c "rdisc6 -d -m $NCSI_IF -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 )) |