Help - Search - Members - Calendar
Full Version: I solved DHCP Problems in DSWifi ...
1Emulation.Com > Official Emulator Forums > DSWifi
HISONA
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.
stripwax
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!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.