summaryrefslogtreecommitdiff
path: root/FS/FS/svc_IP_Mixin.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2016-04-04 18:58:13 -0700
committerIvan Kohler <ivan@freeside.biz>2016-04-04 18:58:13 -0700
commitdb02f61252803872f2acc3dd885b693d345cc5c3 (patch)
tree86b07d9e0cfcb7ce1fed8d3a9a302d10cb7619ad /FS/FS/svc_IP_Mixin.pm
parent4489e44c81a287345eca825e4a17beafc60b004b (diff)
set Motorola-Canopy-Gateway, RT#41261
Diffstat (limited to 'FS/FS/svc_IP_Mixin.pm')
-rw-r--r--FS/FS/svc_IP_Mixin.pm18
1 files changed, 4 insertions, 14 deletions
diff --git a/FS/FS/svc_IP_Mixin.pm b/FS/FS/svc_IP_Mixin.pm
index abafe86..8b2b5f1 100644
--- a/FS/FS/svc_IP_Mixin.pm
+++ b/FS/FS/svc_IP_Mixin.pm
@@ -186,7 +186,9 @@ means "Framed-Route" if there's an attached router.
sub radius_reply {
my $self = shift;
+
my %reply = ();
+
if ( my $block = $self->attached_block ) {
# block routed over dynamic IP: "192.168.100.0/29 0.0.0.0 1"
# or
@@ -196,21 +198,9 @@ sub radius_reply {
($self->ip_addr || '0.0.0.0') . ' 1';
}
- if ( $self->router_routernum && FS::Conf->new->exists('radius-canopy') ) {
-
- my @addr_block =
- qsearch('addr_block', { routernum => $self->router_routernum } );
- if ( @addr_block ) {
-
- #?
- warn "Multiple address blocks attached to this service's router; using first"
- if scalar(@addr_block) > 1;
+ $reply{'Motorola-Canopy-Gateway'} = $self->addr_block->ip_gateway
+ if FS::Conf->new->exists('radius-canopy') && $self->addr_block;
- $reply{'Motorola-Canopy-Gateway'} = $addr_block[0]->ip_gateway
-
- }
-
- }
%reply;
}