From 6839048a177afdbf9b1d6a8db83c972956b02e7f Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 14 May 2013 15:28:11 +0000 Subject: [PATCH] Fix networkutils to work with CIDR again git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16297 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/NetworkUtils.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index c17c785e6..b0d90ae3f 100755 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -422,11 +422,6 @@ sub ishostinsubnet { if ($ip =~ /:/) {#ipv6 $numbits=128; } - # IPv6 subnet with netmask postfix like /64 - if ($subnet && ($subnet =~ /\//)) - { - $subnet =~ s/\/.*$//; - } if ($mask) { if ($mask =~ /\//) { $mask =~ s/^\///; @@ -442,6 +437,10 @@ sub ishostinsubnet { die "ishostinsubnet must either be called with a netmask or CIDR /bits notation"; } } + if ($subnet && ($subnet =~ /\//)) #remove CIDR suffix from subnet + { + $subnet =~ s/\/.*$//; + } $ip = getipaddr($ip,GetNumber=>1); $subnet = getipaddr($subnet,GetNumber=>1); $ip &= $mask;