PacketFence - BTS - PacketFence
View Issue Details
0001789PacketFenceradiuspublic2014-04-28 18:262014-05-07 08:30
victor 
fdurand 
normalminoralways
resolvedfixed 
AllAllAll
 
 
0001789: Unable extract SSID on Cisco 1142

Cisco 1142 apparently sends multiple Cisco-AVPair records back to the radius server and trips over extractSsid sub.

tail -f logs/packetfence.log

Apr 28 08:13:46 pf::WebAPI(4307) INFO: Unable to extract SSID of Cisco-AVPair: ARRAY(0xbaf6fcc8) (pf::SNMP::Cisco::Aironet::extractSsid)


Output from /usr/sbin/radiusd -X -d /usr/local/pf/raddb/

        Cisco-AVPair = "ssid=TEST"
        Service-Type = Login-User
        Cisco-AVPair = "service-type=Login"




As a quick workaround I changed $radius_request->{'Cisco-AVPair'} into $radius_request->{'Cisco-AVPair'}[0] but a permanent fix should be better than that.
No tags attached.
patch extractSsid.patch (978) 2014-05-05 14:49
https://www.packetfence.org/bugs/file_download.php?file_id=207&type=bug
Issue History
2014-04-28 18:26victorNew Issue
2014-05-05 14:42victorNote Added: 0003532
2014-05-05 14:49victorNote Added: 0003533
2014-05-05 14:49victorFile Added: extractSsid.patch
2014-05-06 08:18fdurandNote Added: 0003535
2014-05-07 08:30fdurandNote Added: 0003537
2014-05-07 08:30fdurandStatusnew => resolved
2014-05-07 08:30fdurandResolutionopen => fixed
2014-05-07 08:30fdurandAssigned To => fdurand

Notes
(0003532)
victor   
2014-05-05 14:42   
Take a look at the patch below. extractSsid should be able to go through multiple Cisco-AVPair records to find the ssid.



--- packetfence-4.1.0/lib/pf/SNMP/Cisco/Aironet.pm 2013-12-11 12:40:14.000000000 -0700
+++ ../lib/pf/SNMP/Cisco/Aironet.pm 2014-05-05 06:27:44.115673527 -0600
@@ -203,11 +203,14 @@
     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);
+ }
         }
     }
(0003533)
victor   
2014-05-05 14:49   
Copy-paste seems to wrecked formatting. The patch file is attached.
(0003535)
fdurand   
2014-05-06 08:18   
Hello Victor,

your patch has been included in the devel version so it will be available for the incoming 4.2 version.

https://github.com/inverse-inc/packetfence/commit/60a7e01bd0d20d0873e253b018ec19f260eeceab [^]

Fabrice
(0003537)
fdurand   
2014-05-07 08:30   
Available in pf 4.2 release