DHCPLEASEQUERY is assigned a value of 10, per RFC4388, however Net::DHCP::Contstants (installed with Net::DHCP::Packet) has the pre-standard value of 13.
Steps to Reproduce:
1. Attempt to use Net::DHCP::Packet with a DHCP_MESSAGE set to DHCPLEASEQUERY
2. Since value of DHCPLEASEQUERY is incorrect (13) the packet is ignored by the DHCP server.
3. The following example is from the documentation for Net::DHCP::Packet. Substituting the value 10 for DHCPLEASEQUERY will change this from a non-working to working script.
# Simple DHCP client - send a LeaseQuery (by IP) and receive the response
$usage = "usage: $0 DHCP_SERVER_IP DHCP_CLIENT_IP\n"; $ARGV || die $usage;
# create a socket
$handle = IO::Socket::INET->new(Proto => 'udp',
Broadcast => 1,
PeerPort => '67',
LocalPort => '67',
timeout => 5,
PeerAddr => $ARGV)
or die "socket: $@"; # yes, it uses $@ here
# create DHCP Packet
$inform = Net::DHCP::Packet->new(op => BOOTREQUEST(),
Htype => '0',
Hlen => '0',
Ciaddr => $ARGV,
Giaddr => $handle->sockhost(),
Xid => int(rand(0xFFFFFFFF)), # random xid
DHO_DHCP_MESSAGE_TYPE() => DHCPLEASEQUERY
# send request
$handle->send($inform->serialize()) or die "Error sending LeaseQuery: $!\n";
$handle->recv($newmsg, 1024) or die;
$packet = Net::DHCP::Packet->new($newmsg);
DHCP query is ignored
DHCP server responds with LEASEQUERY data (or at least logs a failed message in the DHCP daemon's log file)
A message has been sent to the package's author shadinger at cpan (dot org)
From what portage package this module comes from?
Do we have Net-DHCP in the tree?
There is a bug report at http://rt.cpan.org/Public/Bug/Display.html?id=32962 too
My bad... I installed this using CPAN, not portage. Apologies for the mistake.