diff --git a/Shorewall/lib.core b/Shorewall/lib.core index e8dbb21ad..660143cf7 100644 --- a/Shorewall/lib.core +++ b/Shorewall/lib.core @@ -176,8 +176,24 @@ interface_is_up() { # interface_is_usable() # $1 = interface { - [ "$1" = lo -o $COMMAND = enable ] && return 0 - interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != :: ] && run_isusable_exit $1 + local status; + status=0 + + if [ "$1" != lo ]; then + if [ $g_family -eq 4 ]; then + if interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != 0.0.0.0 -a "$COMMAND" != enable ]; then + run_isusable_exit $1 + status=$? + fi + else + if interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != :: -a "$COMMAND" != enable ]; then + run_isusable_exit $1 + status=$? + fi + fi + fi + + return $status } #