Ensure we have a valid broadcast address.

This commit is contained in:
Roy Marples 2009-11-11 00:31:32 +00:00
parent d29daf3952
commit d21177e5c7

View File

@ -107,8 +107,14 @@ intup=false
runip()
{
local int="$1" err=
shift
# Ensure we have a valid broadcast address
case "$@" in
*" broadcast "*|*" brd "*) ;;
*) set -- "$@" brd +;;
esac
err=$(LC_ALL=C ip address add "$@" dev "$int" 2>&1)
if [ -z "$err" ]; then
# ip does not bring up the interface when adding addresses