Skip to content

Commit

Permalink
Merge pull request #6727 from inverse-inc/feature/cli-login-edge-switch
Browse files Browse the repository at this point in the history
Ubiquiti EdgeSwitch: set NAS-Port-Type to virtual when undef
  • Loading branch information
fdurand committed Jan 25, 2022
2 parents cf64d85 + d135fec commit 477722c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/pf/Switch/Ubiquiti/EdgeSwitch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use warnings;
use pf::log;

use base ('pf::Switch::Ubiquiti');
use pf::util qw(clean_mac);
use pf::constants;
use pf::config qw(
$WIRED_802_1X
Expand Down Expand Up @@ -233,6 +234,25 @@ sub getVoipVsa {
);
}

=item parseRequest
=cut

sub parseRequest {
my ( $self, $radius_request ) = @_;

my $client_mac = ref($radius_request->{'Calling-Station-Id'}) eq 'ARRAY'
? clean_mac($radius_request->{'Calling-Station-Id'}[0])
: clean_mac($radius_request->{'Calling-Station-Id'});
my $user_name = $self->parseRequestUsername($radius_request);
my $nas_port_type = ( defined($radius_request->{'NAS-Port-Type'}) ? $radius_request->{'NAS-Port-Type'} : "virtual" );
my $port = $radius_request->{'NAS-Port'};
my $eap_type = ( exists($radius_request->{'EAP-Type'}) ? $radius_request->{'EAP-Type'} : 0 );
my $nas_port_id = ( defined($radius_request->{'NAS-Port-Id'}) ? $radius_request->{'NAS-Port-Id'} : undef );

return ($nas_port_type, $eap_type, $client_mac, $port, $user_name, $nas_port_id, undef, $nas_port_id);
}

=head1 AUTHOR
Inverse inc. <info@inverse.ca>
Expand Down

0 comments on commit 477722c

Please sign in to comment.