projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
set Motorola-Canopy-Gateway, RT#41261
[freeside.git]
/
FS
/
FS
/
svc_IP_Mixin.pm
diff --git
a/FS/FS/svc_IP_Mixin.pm
b/FS/FS/svc_IP_Mixin.pm
index
ff7c2f5
..
c0f202e
100644
(file)
--- a/
FS/FS/svc_IP_Mixin.pm
+++ b/
FS/FS/svc_IP_Mixin.pm
@@
-1,9
+1,10
@@
package FS::svc_IP_Mixin;
package FS::svc_IP_Mixin;
+use base 'FS::IP_Mixin';
use strict;
use strict;
-use base 'FS::IP_Mixin';
-use FS::Record qw(qsearchs qsearch);
use NEXT;
use NEXT;
+use FS::Record qw(qsearchs qsearch);
+use FS::Conf;
=item addr_block
=item addr_block
@@
-96,7
+97,12
@@
sub _used_addresses {
my %hash = ( $ip_field => { op => '!=', value => '' } );
#$hash{'blocknum'} = $block->blocknum if $block;
$hash{'svcnum'} = { op => '!=', value => $exclude->svcnum } if ref $exclude;
my %hash = ( $ip_field => { op => '!=', value => '' } );
#$hash{'blocknum'} = $block->blocknum if $block;
$hash{'svcnum'} = { op => '!=', value => $exclude->svcnum } if ref $exclude;
- map { $_->NetAddr->addr } qsearch($class->table, \%hash);
+ map { my $na = $_->NetAddr; $na ? $na->addr : () }
+ qsearch({
+ table => $class->table,
+ hashref => \%hash,
+ extra_sql => " AND $ip_field != '0e0'",
+ });
}
sub _is_used {
}
sub _is_used {
@@
-178,16
+184,18
@@
means "Framed-Route" if there's an attached router.
sub radius_reply {
my $self = shift;
sub radius_reply {
my $self = shift;
- my %reply;
- my ($block) = $self->attached_block;
- if ( $block ) {
+ my %reply = ();
+ if ( my $block = $self->attached_block ) {
# block routed over dynamic IP: "192.168.100.0/29 0.0.0.0 1"
# or
# block routed over fixed IP: "192.168.100.0/29 192.168.100.1 1"
# (the "1" at the end is the route metric)
# block routed over dynamic IP: "192.168.100.0/29 0.0.0.0 1"
# or
# block routed over fixed IP: "192.168.100.0/29 192.168.100.1 1"
# (the "1" at the end is the route metric)
- $reply{'Framed-Route'} =
- $block->cidr . ' ' .
- ($self->ip_addr || '0.0.0.0') . ' 1';
+ $reply{'Framed-Route'} = $block->cidr . ' ' .
+ ($self->ip_addr || '0.0.0.0') . ' 1';
+
+ $reply{'Motorola-Canopy-Gateway'} = $block->ip_gateway
+ if FS::Conf->new->exists('radius-canopy');
+
}
%reply;
}
}
%reply;
}