From 327ea4113cea590f4d2c33bb430421158ebf51fa Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 19 Mar 2010 15:33:04 -0700 Subject: Need explicit return to guarantee returning false If perl function falls off the end, it will return the result of the last expression. For these functions, the idea was to return a false value; and it the return was missing. --- lib/Vyatta/Misc.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Vyatta/Misc.pm b/lib/Vyatta/Misc.pm index 77c6218..f4f9bfc 100755 --- a/lib/Vyatta/Misc.pm +++ b/lib/Vyatta/Misc.pm @@ -62,7 +62,7 @@ sub is_dhcp_enabled { return 1 if ( $addr && $addr eq "dhcp" ); } - # return undef + return; } # check if any non-dhcp addresses configured @@ -77,7 +77,7 @@ sub is_address_enabled { return 1 if ( $addr && $addr ne 'dhcp' ); } - # return undefined (ie false) + return; } # return dhclient related files for interface @@ -186,7 +186,7 @@ sub getNetAddrIP { return $ip; } - # default return of undefined (ie false) + return; } sub is_ip_v4_or_v6 { @@ -207,7 +207,7 @@ sub is_ip_v4_or_v6 { return 6; } - # default return of undefined (ie false) + return; } sub isIpAddress { @@ -269,7 +269,7 @@ sub isIPinInterfaces { return 1 if ( is_ip_in_list( $ip_addr, getIP($name) ) ); } - # false (undef) + return; # false (undef) } sub isClusteringEnabled { -- cgit v1.2.3