Hello list, dhcp.pm handles mac addresses for agent remote ids only currently. pfdhcplistener does not log activites about option 82 in debug mode. I would like to supply the following patches.
--- lib/pf/util/dhcp.pm.20140716 2014-07-16 21:13:26.535011217 +0200 +++ lib/pf/util/dhcp.pm 2014-07-19 19:00:45.043892881 +0200 @@ -285,6 +285,12 @@ if ( defined( $sub_opt_82{'2'} ) ) { $dhcp_ref->{'options'}{'82'}{'switch'} = clean_mac( unpack("H*", pack("C*", @{$sub_opt_82{'2'}})) ); + # clean_mac returns '0' if it wasn't a mac - make a 2nd try with int2ip + # TODO this will break with ipv6 addressing + if ($dhcp_ref->{'options'}{'82'}{'switch'} == '0') { + $dhcp_ref->{'options'}{'82'}{'switch'} = int2ip(unpack("N", (pack("C*", @{$sub_opt_82{'2'}} )) )); + } + } } --- sbin/pfdhcplistener.20140716 2014-07-19 18:15:40.863756196 +0200 +++ sbin/pfdhcplistener 2014-07-19 18:17:19.139762358 +0200 @@ -277,6 +277,10 @@ # Option 82 Relay Agent Information (RFC3046) if ( isenabled( $Config{'network'}{'dhcpoption82logger'} ) && defined( $dhcp->{'options'}{'82'} ) ) { parse_dhcp_option82($dhcp); + + $logger->debug("Option 82 is enabled - parse_dhcp_option82 is called"); + $logger->debug("Option 82 - Agent Remote ID is $dhcp->{'options'}{'82'}{'switch'}"); + $logger->debug("Option 82 - Agent Circuit ID is $dhcp->{'options'}{'82'}{'vlan'}"); } # updating the node first I have not been able to see this information in the location log and i have no idea how it should get there. This will be my next task. Kind regards, David ________________________________ Klinikum Nürnberg, Sitz: Nürnberg, Amtsgericht Nürnberg -Registergericht- HRA 14190, Vorstand: Dr. Alfred Estelmann ------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds _______________________________________________ PacketFence-devel mailing list PacketFence-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/packetfence-devel