[pve-devel] [PATCH] be sure to have the bridge up

Stefan Priebe - Profihost AG s.priebe at profihost.ag
Fri Mar 23 08:36:16 CET 2012


Am 23.03.2012 08:33, schrieb root:
> 
> Signed-off-by: root <aderumier at odiso.com>
> ---
>  pve-bridge |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/pve-bridge b/pve-bridge
> index 73f2b34..04c2096 100755
> --- a/pve-bridge
> +++ b/pve-bridge
> @@ -63,6 +63,10 @@ if ($net->{rate}) {
>  
>  }
>  
> +#be sure to have the bridge up
> +system ("/sbin/ip link set $bridge up") == 0 ||
> +    die "can't up bridge $bridge\n";

Don't use || here use or instead. Cause || also return the specific
return value. And were not interested in the return value. It doesn't
make a difference while executing the code but in theorie or is faster
in such a case.

Always use "and" and "or" instead of && and || if you do not need the
return value.

Stefan



More information about the pve-devel mailing list