aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoachim Tingvold <joachim@tingvold.com>2015-03-22 21:58:46 +0100
committerJoachim Tingvold <joachim@tingvold.com>2015-03-22 21:58:46 +0100
commit5ec4e3f45a1c74a1da58e7f46f7b58f40bdd9e1e (patch)
tree104e0cd4f29876b9d9f6874daff74551361979e0
parent4996a9547061b53b7d3ae7d5785a5844aa30a297 (diff)
The fail is strong in this one.
-rwxr-xr-xbootstrap/make-dhcpd.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/bootstrap/make-dhcpd.pl b/bootstrap/make-dhcpd.pl
index 4052212..e6104af 100755
--- a/bootstrap/make-dhcpd.pl
+++ b/bootstrap/make-dhcpd.pl
@@ -29,11 +29,11 @@ my $pri_net = $pri_range->ip();
my $sec_range = Net::IP->new($nms::config::sec_net_v4) or die ("sec_range fail");
my $sec_mask = $sec_range->mask();
my $sec_net = $sec_range->ip();
-(my $sec_last = $sec_range->last()) =~ s/\/[0-9]{1,2}//;
-(my $sec_gw = $sec_range->first()) =~ s/\/[0-9]{1,2}//;
-my $sec_num = $sec_range->num();
+(my $sec_last = NetAddr::IP->new($nms::config::sec_net_v4)->last()) =~ s/\/[0-9]{1,2}//;
+(my $sec_gw = NetAddr::IP->new($nms::config::sec_net_v4)->first()) =~ s/\/[0-9]{1,2}//;
+my $sec_num = NetAddr::IP->new($nms::config::sec_net_v4)->num();
my $sec_n = $sec_num - int($sec_num / 4); # don't use more than 1/4 of the net for DHCP
-(my $sec_first = $sec_range->nth($sec_n)) =~ s/\/[0-9]{1,2}//;
+(my $sec_first = NetAddr::IP->new($nms::config::sec_net_v4)->nth($sec_n)) =~ s/\/[0-9]{1,2}//;
# Create main configuration file for DHCP
if ( not -f $dhcpd_conf )