dhcpleasequery problems - 4.2.2
Jack Kielsmeier
jackkiel at netins.net
Tue Oct 18 17:44:19 UTC 2011
I get an error when re-compiling the source. I have the following commented
out:
if (lease->ends > cur_time) {
/* if (time_expiry < cur_time) {
* log_error("Impossible condition at %s:%d.",
* MDL);
*
* option_state_dereference(&options, MDL);
* lease_dereference(&lease, MDL);
* return;
*/ }
time_expiry = htonl(lease->ends - cur_time);
if (!add_option(options,
DHO_DHCP_LEASE_TIME,
&time_expiry,
sizeof(time_expiry))) {
option_state_dereference(&options, MDL);
lease_dereference(&lease, MDL);
log_info("%s: out of memory, no reply sent",
msgbuf);
return;
}
}
Line 498 is " time_expiry = htonl(lease->ends - cur_time);", but I believe
that needs stay in? Or should that be commented out as well. If it's
commented out it does compile (but I have not tested leasequeries with it
yet).
With line 498 left in, I get the following when compiling:
dhcpleasequery.c:668: warning: data definition has no type or storage class
dhcpleasequery.c:669: error: syntax error before '&' token
dhcpleasequery.c:669: warning: type defaults to `int' in declaration of
`option_state_dereference'
dhcpleasequery.c:669: warning: data definition has no type or storage class
dhcpleasequery.c:670: error: syntax error before '&' token
dhcpleasequery.c:670: warning: type defaults to `int' in declaration of
`lease_dereference'
dhcpleasequery.c:670: warning: data definition has no type or storage class
dhcpleasequery.c:672: error: syntax error before '.' token
dhcpleasequery.c:676: error: syntax error before '.' token
dhcpleasequery.c:701: error: syntax error before string constant
dhcpleasequery.c:703: warning: type defaults to `int' in declaration of
`log_info'
dhcpleasequery.c:703: warning: type defaults to `int' in declaration of
`dbg_info'
dhcpleasequery.c:703: warning: type defaults to `int' in declaration of
`assoc_ip_cnt'
dhcpleasequery.c:703: error: syntax error before ')' token
dhcpleasequery.c:706: error: syntax error before numeric constant
dhcpleasequery.c:711: warning: type defaults to `int' in declaration of
`send_packet'
dhcpleasequery.c:711: warning: data definition has no type or storage class
gmake[1]: *** [dhcpd-dhcpleasequery.o] Error 1
gmake[1]: Leaving directory `/usr/local/src/dhcp-4.2.2/server'
gmake: *** [all-recursive] Error 1
Code starting at 668 is:
data_string_forget(&prl, MDL); /* SK: safe, even if empty */
option_state_dereference(&options, MDL);
lease_dereference(&lease, MDL);
to.sin_family = AF_INET;
#ifdef HAVE_SA_LEN
to.sin_len = sizeof(to);
#endif
Any advice is appreciated. Thank You,
-
Jack Kielsmeier
netINS Systems Administrator
systems at netins.net
-----Original Message-----
From: dhcp-users-bounces+jackkiel=netins.net at lists.isc.org
[mailto:dhcp-users-bounces+jackkiel=netins.net at lists.isc.org] On Behalf Of
Jack Kielsmeier
Sent: Tuesday, October 18, 2011 8:50 AM
To: 'Users of ISC DHCP'
Subject: RE: dhcpleasequery problems - 4.2.2
Whoops, good catch on the line number.
I will test removing the code in question to see if the queries function. I
will report back on the results.
Thank You,
-
Jack Kielsmeier
netINS Systems Administrator
systems at netins.net
-----Original Message-----
From: dhcp-users-bounces+jackkiel=netins.net at lists.isc.org
[mailto:dhcp-users-bounces+jackkiel=netins.net at lists.isc.org] On Behalf Of
Shawn Routhier
Sent: Monday, October 17, 2011 5:20 PM
To: Users of ISC DHCP
Subject: Re: dhcpleasequery problems - 4.2.2
On Oct 17, 2011, at 12:10 PM, Jack Kielsmeier wrote:
> Hello,
>
> We are running ISC DHCP 4.2.2 in a redundant fashion (failover peer)
> in Solaris 11 zones (compiled from source).
>
> Recently, we have determined that we need to make use of the DHCP
> leasequery option. In testing, we notice the following occurring in
> our
logs:
>
> ------------ LOGS ------------
>
> Oct 17 13:19:03 dhcp-dsm dhcpd: [ID 702911 local5.error] Impossible
> condition at dhcpleasequery.c:492.
> Oct 17 13:19:09 dhcp-dsm dhcpd: [ID 702911 local5.error] Impossible
> condition at dhcpleasequery.c:492.
> Oct 17 13:19:15 dhcp-dsm dhcpd: [ID 702911 local5.error] Impossible
> condition at dhcpleasequery.c:492.
> Oct 17 13:19:21 dhcp-dsm dhcpd: [ID 702911 local5.error] Impossible
> condition at dhcpleasequery.c:492.
> Oct 17 13:22:34 dhcp-dsm dhcpd: [ID 702911 local5.error] Impossible
> condition at dhcpleasequery.c:492.
> Oct 17 13:22:39 dhcp-dsm dhcpd: [ID 702911 local5.error] Impossible
> condition at dhcpleasequery.c:492.
>
> ------------ END LOGS ------------
>
I think you want line 492 not 432
> Line 432 looks like this:
>
> lease_dereference(&lease, MDL);
>
>
Line 492 deals with checking the lease ends time against the current time.
It also appears to have a bug. I'll have to go look at the history to
figure out what it thinks it's doing.
It appears that you can simply remove the code from 490 to 498
if (time_expiry < cur_time {
stuff
}
But I haven't tested that or verified that the time_expiry isn't being used
in some odd way I don't understand yet. If you do test it we would be
interested in the results.
> Any assistance with this matter would be greatly appreciated. I do not
> know what else to provide (such as the entire dhcpd.conf file, which
> is pretty long).
>
> Thank You,
>
> -
> Jack Kielsmeier
> netINS Systems Administrator
> systems at netins.net
>
_______________________________________________
dhcp-users mailing list
dhcp-users at lists.isc.org
https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
dhcp-users mailing list
dhcp-users at lists.isc.org
https://lists.isc.org/mailman/listinfo/dhcp-users
More information about the dhcp-users
mailing list