--- lib/PXElator/dhcpd.pm 2009/08/03 19:59:08 128 +++ lib/PXElator/dhcpd.pm 2009/08/03 20:53:46 129 @@ -75,6 +75,7 @@ use log; use config; +use pxelinux; our $file; our $transaction = 0; # FIXME predictible transaction numbers @@ -125,13 +126,18 @@ Giaddr => $dhcp->giaddr(), Chaddr => $dhcp->chaddr(), File => $file, - - DHO_PXELINUX_MAGIC() => 0xF100747E, - DHO_PXELINUX_CONFIG_FILE() => 'pxelinux.cfg/default', - DHO_PXELINUX_PATH_PREFIX() => 'live-helper/tftpboot/', - DHO_PXELINUX_REBOOT_TIME() => 5, # default: 300 s }; + foreach my $opt ( 'magic', 'config_file', 'path_prefix', 'reboot_time' ) { + my $DH0 = eval 'DHO_PXELINUX_' . uc $opt; + warn "DH0: $@" if $@; + my $v = eval "\$pxelinux::$opt"; + warn "v: $@" if $@; + next unless defined $v; + warn "pxelinux dhcp option $opt = $DH0 = $v"; + $packet->{ $DH0 } = $v; + } + my $messagetype = $dhcp->getOptionValue(DHO_DHCP_MESSAGE_TYPE()); if ($messagetype eq DHCPDISCOVER()) { @@ -162,6 +168,8 @@ warn ">> $mac == $ip server: $server::ip", $file ? " file: $file\n" : "\n" if $debug; +warn "## created packet ", dump( $packet ); + $packet = new Net::DHCP::Packet( %$packet ); warn "send ",$packet->toString() if $debug;