X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FIP_Mixin.pm;h=beb41d290de4950deb892efc74b44dd643c67091;hp=b3c10528c0e90d645ced635231d5aeb45bf8beb5;hb=389b6f1116c3309c2ee57a6c295ed1a793503095;hpb=a4c1077430ac3b053c30084dcf76c54be45dca08 diff --git a/FS/FS/IP_Mixin.pm b/FS/FS/IP_Mixin.pm index b3c10528c..beb41d290 100644 --- a/FS/FS/IP_Mixin.pm +++ b/FS/FS/IP_Mixin.pm @@ -4,6 +4,7 @@ use strict; use NetAddr::IP; use FS::addr_block; use FS::router; +use FS::addr_range; use FS::Record qw(qsearch); use FS::Conf; # careful about importing anything here--it will end up in a LOT of @@ -152,14 +153,14 @@ sub assign_ip_addr { # don't exit early on assigning a free address--check the rest of # the blocks to see if the current address is in one of them. if (!$new_addr) { - $new_addr = $block->next_free_addr->addr; + $new_addr = $block->next_free_addr; $new_block = $block; } } return 'No IP address available on this router' unless $new_addr; - $self->ip_addr($new_addr); + $self->ip_addr($new_addr->addr); $self->addr_block($new_block); ''; }