--- lib/PXElator/dhcpd.pm 2009/08/17 13:27:18 244 +++ lib/PXElator/dhcpd.pm 2009/08/19 10:56:04 260 @@ -95,17 +95,24 @@ return unless $buf; my $dhcp = Net::DHCP::Packet->new($buf); - $dhcp->comment( $transaction++ ); warn "recv: ", $dhcp->toString if $debug; + $dhcp->comment( $transaction++ ); + my $mac = substr($dhcp->chaddr(),0,$dhcp->hlen()*2); my $ip = client_mac_ip($mac, $dhcp->ciaddr); my $hostname = $dhcp->getOptionValue(DHO_HOST_NAME); print "$ip ", client::conf( $ip => 'hostname', default => $hostname ), " >> /etc/hosts\n"; - my $audit = { mac => format::mac($mac), ip => $ip, hostname => $hostname }; + my $audit = { mac => format::mac($mac), ip => $ip, hostname => $hostname, + options => { + map { + ( $_ => $dhcp->getOptionValue( $_ ) ) + } @{ $dhcp->{options_order} } + }, + }; =for later