When dhcp is first initalized, the times for renewal
are not calculated properly. The code reads:
dhcpc_t1 = (UINT32)((UINT16)(0.5)*temp);
dhcpc_t2 = (UINT32)((UINT16)(0.875)*temp);
due to the casting, the 0.5 and 0.875 will turn to 0,
resulting in dhcpc_t1 and dhcpc_t2 both being set to 0
which will cause a flurry of packets to be sent.
Changing those lines to read:
dhcpc_t1 = temp / 2;
dhcpc_t2 = ((temp << 3) >> 3) * 7 / 8;
fixes the problem, and now when starting up, only four
packets in total are sent instead of many more. (The
shift up/down is to clear out the top three bits so the
multiplication doesn't overflow.)
There are two sets of these lines to be changed.
Nobody/Anonymous
None
None
Public
|
Date: 2008-09-29 14:49 Many thanks for reporting and solving this issue. |