| Summary: | Non-compliant DHCP servers and udhcpc | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Nigel Hathaway <nhathaway> |
| Component: | Networking | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: | Fix | ||
|
Description
Nigel Hathaway
2009-09-29 16:11:07 UTC
To be more specific on this:
In networking/udhcp/dhcpc.c, there is a section for the code that looks like this:
case REBINDING:
/* Lease is *really* about to run out,
* try to find DHCP server using broadcast */
if (timeout > 0) {
/* send a request packet */
send_renew(xid, 0 /*INADDR_ANY*/, requested_ip); /* broadcast */
timeout >>= 1;
continue;
}
/* Timed out, enter init state */
bb_info_msg("Lease lost, entering init state");
udhcp_run_script(NULL, "deconfig");
change_listen_mode(LISTEN_RAW);
state = INIT_SELECTING;
The line "change_listen_mode(LISTEN_RAW);" should really be moved to just below "/* send a request packet */". This is because, if you send a request on broadcast, you would expect a reply on broadcast.
Does this make sense? Have I missed anything?
We have done some tests on a non-compliant router and can confirm that putting "change_listen_mode(LISTEN_RAW);" below "/* send a request packet */" *does* fix the problem described. In fact, the person who tested this copied the line rather than moving it. Created attachment 687 [details]
Fix
Thanks for excellent analysis!
We can move change_listen_mode(LISTEN_RAW) above the (timeout > 0) ... as in an attached patch.
This way we ensure raw listening is on even if timeout == 0, and we do not add the code.
Fixed, will be in 1.16.x |