Skip to content

Commit

Permalink
Fixed ExtractSsid in Cisco Aironet and Change the Vendor in radius di…
Browse files Browse the repository at this point in the history
…ctionary
  • Loading branch information
fdurand committed May 6, 2014
1 parent 00d8fe6 commit 60a7e01
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 19 deletions.
2 changes: 2 additions & 0 deletions NEWS.asciidoc
Expand Up @@ -68,6 +68,7 @@ Enhancements
* Added a file backing for the cache to decrease cache misses
* Allow advanced search of nodes by OS type (#1790)
* The PF RPC client can be configured in the conf/radiusd/radiusd.conf
* Added PacketFence radius dictionary

This comment has been minimized.

Copy link
@extrafu

extrafu May 6, 2014

Member

radius -> RADIUS

Bug Fixes
+++++++++
Expand All @@ -85,6 +86,7 @@ Bug Fixes
* Fixed conversion of wildcards to regular expressions in domains passthroughs
* Fixed display of last IP address of nodes when end_time is in the future
* Fixed XSS issues in Web admin
* Fixed extractSsid for Cisco Aironet and Cisco Aironet WDS
Version 4.1.0 released on 2013-12-11
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
15 changes: 9 additions & 6 deletions lib/pf/Switch/Cisco/Aironet.pm
Expand Up @@ -203,13 +203,16 @@ sub extractSsid {
my $logger = Log::Log4perl::get_logger(ref($this));

if (defined($radius_request->{'Cisco-AVPair'})) {

if ($radius_request->{'Cisco-AVPair'} =~ /^ssid=(.*)$/) { # ex: Cisco-AVPair = "ssid=PacketFence-Secure"
return $1;
} else {
$logger->info("Unable to extract SSID of Cisco-AVPair: ".$radius_request->{'Cisco-AVPair'});
foreach my $ciscoAVPair (@{$radius_request->{'Cisco-AVPair'}}) {
$logger->trace("Cisco-AVPair: ".$ciscoAVPair);

if ($ciscoAVPair =~ /^ssid=(.*)$/) { # ex: Cisco-AVPair = "ssid=PacketFence-Secure"
return $1;
} else {
$logger->info("Unable to extract SSID of Cisco-AVPair: ".$ciscoAVPair);
}
}
}
}

$logger->warn(
"Unable to extract SSID for module " . ref($this) . ". SSID-based VLAN assignments won't work. "
Expand Down
21 changes: 12 additions & 9 deletions lib/pf/Switch/Cisco/Aironet_WDS.pm
Expand Up @@ -199,20 +199,23 @@ Overriding default extractSsid because on Aironet AP SSID is in the Cisco-AVPair

# Same as in pf::Switch::Cisco::Aironet. Please keep both in sync. Once Moose push in a role.
sub extractSsid {
my ($self, $radius_request) = @_;
my $logger = Log::Log4perl::get_logger(__PACKAGE__);
my ($this, $radius_request) = @_;
my $logger = Log::Log4perl::get_logger(ref($this));

if (defined($radius_request->{'Cisco-AVPair'})) {

if ($radius_request->{'Cisco-AVPair'} =~ /^ssid=(.*)$/) { # ex: Cisco-AVPair = "ssid=PacketFence-Secure"
return $1;
} else {
$logger->info("Unable to extract SSID of Cisco-AVPair: ".$radius_request->{'Cisco-AVPair'});
foreach my $ciscoAVPair (@{$radius_request->{'Cisco-AVPair'}}) {
$logger->trace("Cisco-AVPair: ".$ciscoAVPair);

if ($ciscoAVPair =~ /^ssid=(.*)$/) { # ex: Cisco-AVPair = "ssid=PacketFence-Secure"
return $1;
} else {
$logger->info("Unable to extract SSID of Cisco-AVPair: ".$ciscoAVPair);

This comment has been minimized.

Copy link
@cgx

cgx May 6, 2014

Collaborator

info or warning?

}
}
}
}

$logger->warn(
"Unable to extract SSID for module " . ref($self) . ". SSID-based VLAN assignments won't work. "
"Unable to extract SSID for module " . ref($this) . ". SSID-based VLAN assignments won't work. "
. "Make sure you enable Vendor Specific Attributes (VSA) on the AP if you want them to work."
);
return;
Expand Down
8 changes: 4 additions & 4 deletions raddb/dictionary.packetfence
@@ -1,20 +1,20 @@
# -*- text -*-
# Copyright (C) 2012 The FreeRADIUS Server project and contributors
# Copyright (C) 2014 The FreeRADIUS Server project and contributors

This comment has been minimized.

Copy link
@extrafu

extrafu May 6, 2014

Member

The (C) should be:

Copyright (C) 2014 - Inverse inc.

##############################################################################
#
# Inverse Inc.
#
##############################################################################

VENDOR PacketFence 29464
VENDOR Inverse 29464

BEGIN-VENDOR PacketFence
BEGIN-VENDOR Inverse

ATTRIBUTE PacketFence-RPC-Server 1 string
ATTRIBUTE PacketFence-RPC-Port 2 string
ATTRIBUTE PacketFence-RPC-User 3 string
ATTRIBUTE PacketFence-RPC-Pass 4 string
ATTRIBUTE PacketFence-RPC-Proto 5 string

END-VENDOR PacketFence
END-VENDOR Inverse

0 comments on commit 60a7e01

Please sign in to comment.