Opened 2 years ago

Closed 3 months ago

#13385 closed bug (fixed)

First DHCP lookup times out when to connecting to WIFI

Reported by: tqh Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Servers/net_server Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

When connecting to wifi, first DHCP lookup fails. As its timeout is four seconds, it takes a long time to connect.

Not sure why it fails, probably fails to send first packets. I made a patch to DHCP which timeouts after a few mS and it connects four seconds faster.

Attachments (2)

dhcp_test.patch (1.1 KB) - added by tqh 2 years ago.
Very short initial timeout
dhcp.patch (5.1 KB) - added by tqh 2 years ago.
Updated with header

Download all attachments as: .zip

Change History (14)

Changed 2 years ago by tqh

Attachment: dhcp_test.patch added

Very short initial timeout

comment:1 Changed 2 years ago by tqh

Has a Patch: set

comment:2 Changed 2 years ago by tqh

Patch should not be applied as is, only to show how it was tested.

comment:3 Changed 2 years ago by diver

Component: - GeneralServers/net_server
Owner: changed from nobody to axeld

comment:4 Changed 2 years ago by axeld

Would be nice to find the cause of the first failure, but there is little that speaks against using a more aggressive retry interval here. It's used to reduce the load of the server when many clients going through a DHCP negotiation at once -- since current hardware is much more capable, and since this happens quite rarely anyway, I'm all for a shorter cycle.

comment:5 Changed 2 years ago by tqh

Yes, not sure how to track the failure down easily though. If anyone can check if it also fails on first try on cable (I don't have hardware) we'd have some more clues.

comment:6 Changed 2 years ago by tqh

Proposing these changes to dhcp-client, I changed the max comparison to a min one as it just seemed wrong to me.

Changed 2 years ago by tqh

Attachment: dhcp.patch added

Updated with header

comment:7 Changed 2 years ago by tqh

We are getting 'Operation timed out' but bytes received are not < 0 here: http://cgit.haiku-os.org/haiku/tree/src/servers/net/DHCPClient.cpp#n683

So no if case is taken.

comment:8 Changed 2 years ago by tqh

Oh, errno is not updated on success.

comment:9 Changed 2 years ago by tqh

DHCP timeouts changed in hrev51039.

comment:10 Changed 2 years ago by tqh

Has a Patch: unset

comment:11 Changed 2 years ago by axeld

Owner: changed from axeld to nobody
Status: newassigned

comment:12 Changed 3 months ago by waddlesplash

Resolution: fixed
Status: assignedclosed

Remaining issues tracked in #14307.

Note: See TracTickets for help on using tickets.