[En-Nut-Discussion] DHCP Issues
Harald Kipp
harald.kipp at egnite.de
Tue Feb 17 16:34:46 CET 2015
Hi Coleman,
On 16.02.2015 18:25, Coleman Brumley wrote:
> (NutDhcpClient) isn't automatically issuing a renew based on the renewal
> period issued by my DHCP server.
I'm unable to reproduce the problem. Here is what I did:
Change "#if 0" to "#if 1" to enable local debugging.
#if 1
/* Use for local debugging. */
...
#endif
Override renewal time (I do not want to change our office DHCP):
cfgp->dyn_renewalTime = ntohl(lval);
cfgp->dyn_renewalTime = 60;
Each minute I get the following on stdout:
[1.DHCP-BOUND 60]
[1.DHCP-RENEWING 60][DHCP-Send to 192.168.1.1][DHCP-Recv from
192.168.1.1][DHCP-Opt-53][DHCP-Opt
-1][DHCP-Opt-3][DHCP-Opt-6][DHCP-Opt-12][DHCP-Opt-15][DHCP-Opt-28][DHCP-Opt-38]
[DHCP-Opt-51][DHCP-Opt-54][DHCP-Opt-58][DHCP-Opt-59]
[2.DHCP-BOUND 0]
So, renewal takes place as expected.
> On another note, the DHCP ParseReply seems to be crashing when it receives
> options that it doesn't know how to parse (options 249, and 252 for
> example). This is occurring when Microsoft machines are broadcasting DHCP
> INFORM requests.
Quite unlikely, because almost any DHCP server will send options not
known to our DHCP client.
To
/* Total lease time granted. */
else if (*op == DHCPOPT_LEASETIME) {
cfgp->dyn_leaseTime = ntohl(lval);
}
I appended
else {
printf("Unknown %u(%u)\n", *op, ol);
}
which results in
Unknown 38(4)
without crashing.
Not exactly your environment, but I can hardly imagine that this won't
work elsewhere. What I assume is, that you are running out of stack
space. Among other things, this depends on compiler versions.
See the software manual
http://www.ethernut.de/pdf/enswm28e.pdf
on page 46ff as well as
http://lists.egnite.de/pipermail/en-nut-discussion/2009-April/024939.html
Please let us know, if this solved your problem.
Regards,
Harald
More information about the En-Nut-Discussion
mailing list