Using $_bcast to determine if the address is an IPv6 one is lazy. It
causes anyone reading the code (including the original author) to have
to go back and confirm that the condition makes sense.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
# Only need to define broadcast for IPv4
case "$_ip" in
- *:*) _bcast="" ;;
- *) _bcast="brd +" ;;
+ *:*)
+ _bcast=""
+ _ipv6=true
+ ;;
+ *)
+ _bcast="brd +"
+ _ipv6=false
+ ;;
esac
# Intentionally unquoted multi-word value here
fi
# Wait 5 seconds for IPv6 addresses to stop being tentative...
- if [ -z "$_bcast" ]; then
+ if $_ipv6; then
_ip="${_prefix%/*}"
for _x in $(seq 1 10); do
ip addr show to "${_ip}/128" | grep -q "tentative" || break