projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 30783 Clean up IP utility code
[freeside.git]
/
FS
/
FS
/
IP_Mixin.pm
diff --git
a/FS/FS/IP_Mixin.pm
b/FS/FS/IP_Mixin.pm
index
3ec7693
..
b68b0b6
100644
(file)
--- a/
FS/FS/IP_Mixin.pm
+++ b/
FS/FS/IP_Mixin.pm
@@
-264,18
+264,22
@@
sub router {
FS::router->by_key($self->routernum);
}
FS::router->by_key($self->routernum);
}
-=item used_addresses [
BLOCK
]
+=item used_addresses [
FS::addr_block
]
-Returns a list of all addresses
(in BLOCK, or in all blocks)
-that are in use. If called as an instance method, excludes
-that instance from the search.
+Returns a list of all addresses
in use within the given L<FS::addr_block>.
+
+
If called as an instance method, excludes
that instance from the search.
=cut
sub used_addresses {
=cut
sub used_addresses {
- my $self = shift;
- my $block = shift;
- return ( map { $_->_used_addresses($block, $self) } @subclasses );
+ my ($self, $block) = @_;
+
+ (
+ $block->ip_gateway ? $block->ip_gateway : (),
+ $block->NetAddr->broadcast->addr,
+ map { $_->_used_addresses($block, $self ) } @subclasses
+ );
}
sub _used_addresses {
}
sub _used_addresses {