This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: DHCP crash with Novell Server
- To: ecos-discuss at sources dot redhat dot com
- Subject: [ECOS] Re: DHCP crash with Novell Server
- From: Grant Edwards <grante at visi dot com>
- Date: Tue, 19 Jun 2001 15:44:51 -0500
- References: <20010619143304.A9666@visi.com>
On Tue, Jun 19, 2001 at 02:33:04PM -0500, Grant Edwards wrote:
> However, when used with a Novell Netware 5.0 server it crashes
> (the board resets) when the IP lease expires (600 seconds in
> the example below).
[...]
> 1. Novell server doesn't send T1 renewal time (option 58)
> 2. Novell server doesn't send T2 rebind time (option 59)
Here's what seems to be happening:
1) The code in dhcp_proto.c:new_lease() doesn't check the
return status of get_bootp_option(). Since there are no
rebind (T2) and renewal (T1) time options, it ends up
reusing the IP lease time value for those two.
We end up with least->t1 == lease->t2 == lease->expiry.
2) Set an alarm for now+lease->t1
3) Alarm goes off.
4) alarm_function() gets called.
It sets a new alarm for lease->t2
(same as lease->t1, IOW: now.)
It enables the alarm.
note: It hasn't yet changed the state variable lease->next.
goto 3)
After 40-50 nested calls to alarm_function(), the stack blows.
Here are the fixes I plan on trying:
1) in alarm_function() change the state variable _before_
re-enabling the alarm. That will limit the nesting level
to 3.
With no other changes, this will cause the lease to expire
(AFAICT).
2) in new_lease(), check the return value of
get_bootp_option() and set default values for T1 and T2 if
the server doesn't provide them.
My understanding of the RFCs is that a server is required to
provide an IP lease expiry time, but is not required to specify
T1 and T2.
I don't know if client behavior in absence of T1/T2 options is
defined. In a different client, I've defaulted T1 and T2 to
1/2 expiry and 3/4 expiry.
Perhaps the proper behavior is just to wait for the IP lease to
expire and start from scratch (start with a DISCOVERY rather
than a REQUEST), but it doesn't appear that this is what the
eCos routines do when the lease expires. Rather, they shut
down the interface and give up, right?
Stay tuned...
--
Grant Edwards
grante@visi.com