add timeout to ping6 command (#17729)

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
This commit is contained in:
Lawrence Lee 2024-01-10 14:40:15 -08:00 committed by GitHub
parent 24e995024b
commit eb70bff4b7
No account linked to committer's email address

View File

@ -68,7 +68,7 @@ while /bin/true; do
ALL_INTERFACE="$INTERFACE $PC_INTERFACE $VLAN_SUB_INTERFACE" ALL_INTERFACE="$INTERFACE $PC_INTERFACE $VLAN_SUB_INTERFACE"
for intf in $ALL_INTERFACE; do for intf in $ALL_INTERFACE; do
ping6cmd="ping6 -I $intf -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null" ping6cmd="timeout 0.2 ping6 -I $intf -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null"
intf_up=$(ip link show $intf | grep "state UP") intf_up=$(ip link show $intf | grep "state UP")
if [[ -n "$intf_up" ]]; then if [[ -n "$intf_up" ]]; then
eval $ping6cmd eval $ping6cmd