Jump to content

I solved DHCP Problems in DSWifi ...


HISONA

Recommended Posts

Hi,

 

In some AP router(I'm using AnyGate ..), DSWifi can't get IP Address from the DHCP Server...

So, I changed the DHCP source code in "arm9/source/sgIP_DHCP.c".

If you any problems, send me feedback ....

 

You can get the changed source code in here .

 

 

1. In sgIP_DHCP_Start function, remarks the setting to non-blocking socket ..

 

 

/*

i=1;

ioctl(dhcp_socket,FIONBIO,&i);

 

*/

 

 

2. In sgIP_DHCP_Update function, use the select function

 

 

struct timeval tv;

fd_set readfds;

 

 

tv.tv_sec=1;

tv.tv_usec=0;

 

FD_ZERO(&readfds);

FD_SET(dhcp_socket, &readfds);

 

 

if(select(dhcp_socket+1, &readfds, NULL, NULL, &tv) <= 0) break;

 

 

l=recvfrom(dhcp_socket,p,sizeof(sgIP_DHCP_Packet),0,(struct sockaddr *)&sain,&n);

if(l==-1) break;

 

Had some trouble with that download link; attached here for convenience.

sgip_dhcp_hisona.zip

Edited by Robert
Link to comment
Share on other sites

  • 1 month later...

dswifi 0.3.3 also includes a fix to DHCP, but doesn't include your non-blocking fix.

With dswifi 0.3.3, DHCP works for me now (and it didn't previously work before - I have a Netgear DG834Gv2 router).

 

If you download the latest dswifi from sourceforge does it work for you? or is your nonblocking fix also required to get DHCP working for you? If so it would be worth contacting the dswifi developers (on irc on #dswifi) to get your patch tested/included!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...