From patchwork Tue Feb 13 09:19:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Held X-Patchwork-Id: 1656 Return-Path: Received: from mail01.ipfire.org (mail01.ipfire.org [IPv6:2001:470:7183:25::1]) by web02.i.ipfire.org (Postfix) with ESMTP id A827161917 for ; Mon, 12 Feb 2018 23:20:11 +0100 (CET) X-Virus-Scanned: ClamAV at mail01.ipfire.org Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id ED01D1140A38; Mon, 12 Feb 2018 22:20:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 mail01.ipfire.org ED01D1140A38 Authentication-Results: mail01.ipfire.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail01.ipfire.org; spf=pass smtp.mailfrom=development-bounces@lists.ipfire.org X-Virus-Scanned: ClamAV at mail01.ipfire.org Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 85ADB1140A3B for ; Mon, 12 Feb 2018 22:19:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 mail01.ipfire.org 85ADB1140A3B Authentication-Results: mail01.ipfire.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail01.ipfire.org; spf=pass smtp.mailfrom=berny156@gmx.de Received: from quad.berny.local ([46.244.228.114]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LnOve-1eJRXr2Px0-00haUe for ; Mon, 12 Feb 2018 23:19:37 +0100 From: Bernhard Held To: development@lists.ipfire.org Subject: [PATCH v2 2/4] Network::network2bin: return an empty list in case of error Date: Mon, 12 Feb 2018 23:19:30 +0100 Message-Id: <20180212221932.29122-3-berny156@gmx.de> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180212221932.29122-1-berny156@gmx.de> References: <20180212221932.29122-1-berny156@gmx.de> X-Provags-ID: V03:K0:LvPV6hA7XIY+zLw8cJyvwp5OgaPQIUOAl/zdx/i4CqxH0gOlEpz zkIk0TI6fM3mCIwruOc7NIeJKLp6GIrddTRvZ33kl6llH5ONQ7zrNqgF6OBWS567UWXoICl owacNAU3/+5nRdEyMMQ6TLZRWYpUWnXj2J8Z/Uet/71VpFVGJ+rxt4n2ge9j2uu1OxnX0Zj lF4NpF2CRtOoPKStq0KtQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:KkJSyCitrQ4=:duzA5nmGz9eCLaN9BLSpjm TwFuyh5SfSX4PFKMcJMd9AXpdlC6bY/9ZPUaHC+rqjA5cJ36fiViTGzYSKGF3Xi+qhW/4VqPd emiIcBtMtv0m9w57gyrHojCo1JCws6R7KTkkdRk586RJ4PbP38FgXeCHB3G9JSftLHykrdAxL L6pPhAgYELDGORUTNfOJG0JB9CbpxLgQw1+cdHQjKxLnnHHnfStKHnwIsgrRm4W8TciTtuMYc wt3i8Ti+g5FMCsUV5oaa1Tw2VodTqjYz9JHabBCedTyhRSGXc0/kLuJ0fkn6USxO/MDijGeuz zURzYdrKPbYP8cQm93iKqVtLn+c0SFKK3husvtRFGCQkZH1NwA0+rQUozYA4/Dc5rjimLp9t4 n5j8mh0XVjrMJvIP4dfcUbzwgLSmM6UZighY+Wy+P1H20b+asCy45RRUjJooZFmuDAS9zDki5 hQcjNX52fP3it3c/6J1jw1FvvN/j/N+BekdJ1hXe7w9f28pu4FFXk2Zfy0vf2+55zgm1QN8MD VxeR1RK1ogQGsXFFf/C2IKuYD19NQVHA+9IjZry6EAeUHDCB0bAcrzHbiG9BJkDyy8c02cBzQ gv7zH6dOuLW/nX/L4Ijbg7377Q5OO+kPwA1dAsIGMWs7IQQ7HKoYOuFgAvbfffEnxZktqKTkk /uNOpWq5VAtS4197vayY8mvOXaeQy46CwOoaV2nZlZM8F5NRyJkYFSLdlHAMNtKx/GBcxnIz+ dCE79TK3ln3GjhdBoLEnXVARJbZjOHt0sArIKirg+ImLGJ3Ch8KRmkbtKLWnszYqIslWV5vFR uIHIYTJymY1vo+U//3dt8EdYOIHTw== X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" 'return undef;' will always return a single value 'undef' even in list context. sub foo { return undef } if ( my @x = foo() ) { print "oops, we think we got a result"; } --- config/cfgroot/network-functions.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cfgroot/network-functions.pl b/config/cfgroot/network-functions.pl index 93bb646a6..41d36a194 100644 --- a/config/cfgroot/network-functions.pl +++ b/config/cfgroot/network-functions.pl @@ -139,7 +139,7 @@ sub network2bin($) { my $netmask_bin = &ip2bin($netmask); if (!defined $address_bin || !defined $netmask_bin) { - return undef; + return; } my $network_start = $address_bin & $netmask_bin;