projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
07edc34
)
set Motorola-Canopy-Gateway, RT#41261
author
Ivan Kohler
<ivan@freeside.biz>
Wed, 30 Mar 2016 20:02:30 +0000
(13:02 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Wed, 30 Mar 2016 20:02:30 +0000
(13:02 -0700)
FS/FS/svc_IP_Mixin.pm
patch
|
blob
|
history
diff --git
a/FS/FS/svc_IP_Mixin.pm
b/FS/FS/svc_IP_Mixin.pm
index
c0f202e
..
abafe86
100644
(file)
--- a/
FS/FS/svc_IP_Mixin.pm
+++ b/
FS/FS/svc_IP_Mixin.pm
@@
-5,6
+5,8
@@
use strict;
use NEXT;
use FS::Record qw(qsearchs qsearch);
use FS::Conf;
use NEXT;
use FS::Record qw(qsearchs qsearch);
use FS::Conf;
+use FS::router;
+use FS::part_svc_router;
=item addr_block
=item addr_block
@@
-192,9
+194,21
@@
sub radius_reply {
# (the "1" at the end is the route metric)
$reply{'Framed-Route'} = $block->cidr . ' ' .
($self->ip_addr || '0.0.0.0') . ' 1';
# (the "1" at the end is the route metric)
$reply{'Framed-Route'} = $block->cidr . ' ' .
($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'} = $block->ip_gateway
- if FS::Conf->new->exists('radius-canopy');
+ $reply{'Motorola-Canopy-Gateway'} = $addr_block[0]->ip_gateway
+
+ }
}
%reply;
}
%reply;