X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_IP_Mixin.pm;h=8b2b5f17e9709e73fdb8d8f00b89d263fd74164c;hb=2da1326a2ba34b1e322af040b174f24c618dc1a7;hp=5b06082a1c7f4d9a5441e1b50f3bb3fbc9d4393b;hpb=4e95cbcc7a876017487f098a06b957e79c0acf77;p=freeside.git diff --git a/FS/FS/svc_IP_Mixin.pm b/FS/FS/svc_IP_Mixin.pm index 5b06082a1..8b2b5f17e 100644 --- a/FS/FS/svc_IP_Mixin.pm +++ b/FS/FS/svc_IP_Mixin.pm @@ -1,9 +1,12 @@ package FS::svc_IP_Mixin; +use base 'FS::IP_Mixin'; use strict; -use base 'FS::IP_Mixin'; -use FS::Record qw(qsearchs qsearch); use NEXT; +use FS::Record qw(qsearchs qsearch); +use FS::Conf; +use FS::router; +use FS::part_svc_router; =item addr_block @@ -183,17 +186,21 @@ means "Framed-Route" if there's an attached router. 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) - $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'} = $self->addr_block->ip_gateway + if FS::Conf->new->exists('radius-canopy') && $self->addr_block; + %reply; }