Opened 16 years ago
Closed 16 years ago
#2531 closed bug (fixed)
DHCP changes IP address every 5 minutes
Reported by: | idefix | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Network & Internet | Version: | R1/pre-alpha1 |
Keywords: | Cc: | adek336@… | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
When I connect my Haiku computer to my Windows XP computer (with Internet Connection Sharing enabled), Haiku gets a new IP-address every 5 minutes. BeOS R5 (on the Haiku computer) doesn't show this behaviour.
The network card Haiku uses is a 3Com Etherlink XL 3C900B.
Attachments (32)
Change History (67)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Summary: | DHCP changes IP every 5 minutes → DHCP changes IP address every 5 minutes |
---|
comment:3 by , 16 years ago
Tested again on hrev27964, with RTL8139 network card.
DHCP requests captured on Windows XP with Wireshark. See 'Haiku DHCP requests (hrev27964).txt' (formatted the first couple of lines for readability).
(BellTech_b5:d0:d1 is network card in 'Windows XP'-computer, SurecomT_52:3d:c3 is network card in Haiku-computer)
Packet 259 shows the various DHCP-values. See 'Packet 259.txt'.
by , 16 years ago
Attachment: | Haiku DHCP requests (r27964).txt added |
---|
Wireshark log of DHCP requests by Haiku hrev27964. (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer, SurecomT_52:3d:c3 is network card in Haiku-computer)
by , 16 years ago
Attachment: | Packet 259.txt added |
---|
Details of packet 259, showing various DHCP values.
comment:4 by , 16 years ago
Tested also on the same computer with BeOS. See 'BeOS DHCP requests.txt' (let the computer running for 45 minutes).
by , 16 years ago
Attachment: | BeOS DHCP requests.txt added |
---|
Wireshark log of DHCP requests by BeOS. (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer, SurecomT_52:3d:c3 is network card in Haiku-computer)
comment:5 by , 16 years ago
At least the renewal time looks good :-)
Is it possible that you provide more detailed packet data such as 259? It would be interesting to get a DHCP request + the corresponding ack packet for Haiku (when it tries to renew the lease), and BeOS. Thanks so far!
comment:6 by , 16 years ago
by , 16 years ago
Attachment: | Haiku r28358 summary.txt added |
---|
Wireshark log of DHCP requests by Haiku hrev28358 (summary). (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer, SurecomT_52:3d:c3 is network card in Haiku-computer)
by , 16 years ago
Attachment: | Haiku r28358 details.txt added |
---|
Wireshark log of DHCP requests by Haiku hrev28358 (details). (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer, SurecomT_52:3d:c3 is network card in Haiku-computer)
by , 16 years ago
Attachment: | Haiku r28358.pcap added |
---|
Wireshark log of DHCP requests by Haiku hrev28358 (pcap). (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer, SurecomT_52:3d:c3 is network card in Haiku-computer)
comment:7 by , 16 years ago
To compare with BeOS R5:
Summary: 'BeOS R5 summary.txt'
Details: 'BeOS R5 details.txt'
Pcap: 'BeOS R5.pcap'
by , 16 years ago
Attachment: | BeOS R5 summary.txt added |
---|
Wireshark log of DHCP requests by BeOS R5 (summary). (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer)
by , 16 years ago
Attachment: | BeOS R5 details.txt added |
---|
Wireshark log of DHCP requests by BeOS R5 (details). (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer)
by , 16 years ago
Attachment: | BeOS R5.pcap added |
---|
Wireshark log of DHCP requests by BeOS R5 (pcap). (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer)
comment:8 by , 16 years ago
To compare with FreeBSD 7.0:
Summary: 'FreeBSD 7.0 summary.txt'
Details: 'FreeBSD 7.0 details.txt'
Pcap: 'FreeBSD 7.0.pcap'
by , 16 years ago
Attachment: | FreeBSD 7.0 summary.txt added |
---|
Wireshark log of DHCP requests by FreeBSD 7.0 (summary).
by , 16 years ago
Attachment: | FreeBSD 7.0 details.txt added |
---|
Wireshark log of DHCP requests by FreeBSD 7.0 (details).
by , 16 years ago
Attachment: | FreeBSD 7.0.pcap added |
---|
Wireshark log of DHCP requests by FreeBSD 7.0 (pcap).
comment:9 by , 16 years ago
Cc: | added |
---|
comment:10 by , 16 years ago
Would you care for debugging the problem by adding some diagnostic messages to the source code if I sent in a diff?
comment:12 by , 16 years ago
dhcp.1.diff: let's take a look at who calls DHCLient::DHCLient and DHCLient::_Negotiate.
If you haven't yet, please enable tracing:
mkdir build/user_config_headers cp build/config_headers/tracing_config.h build/user_config_headers/
and edit build/user_config_headers/tracing_config.h so that you have "# define ENABLE_TRACING 1" instead of "# define ENABLE_TRACING 0".
by , 16 years ago
Attachment: | dhcp.1.diff added |
---|
follow-up: 19 comment:13 by , 16 years ago
After rebooting and having Haiku send a few dhcp requests, please press F12 and type trac 0 80 and attach a screenshot of the result.
comment:14 by , 16 years ago
Unfortunately my computer (400 MHz PII, 64 MB) is not really up to the task of building Haiku, but specific components can be build.
Which jam targets should I build after enabling kernel tracing?
comment:18 by , 16 years ago
by , 16 years ago
Attachment: | Haiku r28749 summary.txt added |
---|
Wireshark log of DHCP requests by Haiku hrev28749 (summary). (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer, SurecomT_52:3d:c3 is network card in Haiku-computer)
by , 16 years ago
Attachment: | Haiku r28749 details.txt added |
---|
Wireshark log of DHCP requests by Haiku hrev28749 (details). (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer, SurecomT_52:3d:c3 is network card in Haiku-computer)
by , 16 years ago
Attachment: | Haiku r28749.pcap added |
---|
Wireshark log of DHCP requests by Haiku hrev28749 (pcap). (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer, SurecomT_52:3d:c3 is network card in Haiku-computer)
comment:19 by , 16 years ago
Replying to Adek336:
After rebooting and having Haiku send a few dhcp requests, please press F12 and type trac 0 80 and attach a screenshot of the result.
I must have done something wrong, as haiku hrev28749 won't send any DHCP request after enabling kernel tracing. The system is also behaving strange: slow booting; Tracker won't show the desktop-icons; ProcessController is not shown in the Desktop; applications won't start from the start menu. I think the amount of memory reserved for kernel tracing is a bit high for this machine.
'trac 0 80' gives:
kdebug> trac 0 80 1. [ 49] 63575839: user: DHCP: src/servers/net/NetServer.cpp: _BringUpInterfaces: 830 2. [ 49] 63575857: user: DHCP: src/servers/net/NetServer.cpp: _ConfigureInterface: 490 3. [ 49] 63993595: user: DHCP: src/servers/net/NetServer.cpp: _ConfigureInterface: 682 printed 3 entries within range 1 to 3 (3 of 3 total, 3 ever)
comment:20 by , 16 years ago
I think I found the culprit: MAX_TRACE_SIZE defaults to 20 MB.
I thought it was 1 MB.
comment:21 by , 16 years ago
by , 16 years ago
Attachment: | Haiku r28749 v2 trace.txt added |
---|
Output of 'trac 0 80' in Haiku hrev28749.
by , 16 years ago
Attachment: | Haiku r28749 v2 summary.txt added |
---|
Wireshark log of DHCP requests by Haiku hrev28749 (summary). (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer, SurecomT_52:3d:c3 is network card in Haiku-computer)
by , 16 years ago
Attachment: | dhcp.2.diff added |
---|
follow-up: 23 comment:22 by , 16 years ago
Hah, 20 megs, that's the third of what you have, no wonder it didn't work very well :-)
So DHCP acks are sent, but _Negotiate loops many times trying to fetch one. Btw, how did you manage to save the trace output to a text file? I hope you didn't have to write it down by hand...
Attached is dhcp.2.diff, which will show what happens in the loop. You have to rebuild only the net_server target. Again, trac 0 80 is of interest.
follow-up: 24 comment:23 by , 16 years ago
I hope 'trac 0 200' is ok with you? (Why limit yourself to 80 if you can have it all?) :)
Trace: 'Haiku hrev28749 v3 trace.txt'
Summary: 'Haiku hrev28749 v3 summary.txt'
[...] Btw, how did you manage to save the trace output to a text file? I hope you didn't have to write it down by hand...
No, my null modem cable and HyperTerminal do all the hard work for me. :)
by , 16 years ago
Attachment: | Haiku r28749 v3 trace.txt added |
---|
Output of 'trac 0 80' in Haiku hrev28749. (dhcp.2.diff applied)
by , 16 years ago
Attachment: | Haiku r28749 v3 summary.txt added |
---|
Wireshark log of DHCP requests by Haiku hrev28749 (summary). (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer, SurecomT_52:3d:c3 is network card in Haiku-computer)
by , 16 years ago
Attachment: | dhcp.3.diff added |
---|
by , 16 years ago
Attachment: | dhcp.3.2.diff added |
---|
comment:24 by , 16 years ago
Thanks! Replying to idefix:
I hope 'trac 0 200' is ok with you? (Why limit yourself to 80 if you can have it all?) :)
The more the merrier:)
It looks like it's getting an ACK but rejects it because it finds the value of "state" disheartening.
dhcp.3.diff dhcp.3.2.diff same files. They will trace the value of "state".
by , 16 years ago
Attachment: | dhcp.4.diff added |
---|
comment:26 by , 16 years ago
by , 16 years ago
Attachment: | Haiku r28749 v4 trace.txt added |
---|
Output of 'trac 0 500' in Haiku hrev28749. (dhcp.4.diff applied)
by , 16 years ago
Attachment: | Haiku r28749 v4 summary.txt added |
---|
Wireshark log of DHCP requests by Haiku hrev28749 (summary). (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer, SurecomT_52:3d:c3 is network card in Haiku-computer)
by , 16 years ago
Attachment: | dhcp.5.diff added |
---|
comment:27 by , 16 years ago
this line comes from _CurrentState: 78. [ 64] 709288070: user: DHCP: now 709288017, fLeaseTime 605209288055, fRebindingTime 454009288055, fRenewalTime 709288055 this line means we are supposed to get a new lease: 79. [ 64] 709288089: user: DHCP: src/servers/net/DHCPClient.cpp: MessageReceived: 888 this line should read "RENEWAL" 80. [ 64] 709288099: user: DHCP: state BOUND
It looks like if the message sent from _RestartLease comes ~30 usec early ("now 709288017" < "fRenewalTime 709288055); that sets "state" to BOUND, which _Negotiate doesn't handle very well.
patch.1.diff is proposed patch: send the message 1ms later
dhcp.5.diff is some new debugging code + proposed patch
Apply dhcp.5.diff so if the patch doesn't help, we get some debugging output.
by , 16 years ago
Attachment: | dhcp.5.2.diff added |
---|
by , 16 years ago
Attachment: | patch-dhcp.1.diff added |
---|
comment:28 by , 16 years ago
Use dhcp.5.2.diff, which includes the patch, instead of dhcp.5.diff which doesn't.
comment:29 by , 16 years ago
by , 16 years ago
Attachment: | Haiku r28749 v5 trace.txt added |
---|
Output of 'trac 0 500' in Haiku hrev28749. (dhcp.5.2.diff applied)
by , 16 years ago
Attachment: | Haiku r28749 v5 summary.txt added |
---|
Wireshark log of DHCP requests by Haiku hrev28749 (summary). (BellTech_b5:d0:d1 is network card in 'Windows XP'-computer, SurecomT_52:3d:c3 is network card in Haiku-computer)
comment:30 by , 16 years ago
That's great !
I wonder if it's acceptable for BMessageRunner to be early, isn't it supposed to guarantee not being early.
by , 16 years ago
Attachment: | patch-dhcp.2.diff added |
---|
comment:31 by , 16 years ago
Hello, it looks like BMessageRunner is all well and the problem is that fRenewalTime is fed with system_time() after registering a BMessageRunner which makes the message come early in comparison to fRenewalTime.
Please revert DHCPClient.cpp and then apply patch-dhcp.2.diff, I'm pretty sure that this will help, and we'll call it a day !
comment:32 by , 16 years ago
patch-dhcp.2.diff also fixed the bug. Thanks for fixing!
Can't upload any logs as Trac is broken.
comment:34 by , 16 years ago
Assuming no one beats me to it, I can commit once I'm back home friday evening. Sorry this sort of slipped under the radar!
Normally this computer gets its IP from the ADSL-modem's DHCP-server, but it gives the same IP adddress every time. I still haven't found out how to get the modem to log DHCP requests...