WLAN on 3.03 OE-C -> Host is unreachable

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
benji
Posts: 17
Joined: Fri Oct 14, 2005 2:41 pm

WLAN on 3.03 OE-C -> Host is unreachable

Post by benji »

I'm having trouble getting WLAN to work in user mode for 3.03 OE-C.

I'm using a manually configured connection (WPA Personal) setting and am able to get the IP successfully, but calling sceNetInetConnect produces an errno of 118 = EHOSTUNREACH = "Host is unreachable". This is set after the first call to connect, that is there is no itermediate step to EINPROGRESS.

I'm observing the exact same behaviour with the latest PSPRadio source (Feb 3rd 2007) compiled on a recent toolchain (Feb 2nd 2007). Which leads me to believe there's something weird going on outside my app.

Any ideas?

Thanks,

ben
benji
Posts: 17
Joined: Fri Oct 14, 2005 2:41 pm

Update

Post by benji »

It appears PSPRadio works fine with a connecction that uses DHCP. Has anyone else observed this with other network apps?

I'm assuming most people use DHCP, so I wouldn't be surprised if this hasn't come up before, but just in case... is this a known limitation?

Note that my manual connection works fine when tested through the Network Settings in the VSH.
raf
Posts: 57
Joined: Thu Oct 13, 2005 7:38 am

Re: Update

Post by raf »

benji wrote:It appears PSPRadio works fine with a connecction that uses DHCP. Has anyone else observed this with other network apps?

I'm assuming most people use DHCP, so I wouldn't be surprised if this hasn't come up before, but just in case... is this a known limitation?

Note that my manual connection works fine when tested through the Network Settings in the VSH.
It appears to be a problem with network routing (gateway); as it works fine if you use a proxy (defined inside your LAN). I had this happen, but I recreated my connection (it was manually defined, now automatically), and the problem disappeared.. But the old connection I had it defined from before I upgraded, I just assumed that to be the problem... I guess we need to do more testing...

Raf.
mrlinx
Posts: 9
Joined: Thu Mar 20, 2008 3:24 am

Post by mrlinx »

This problem also appears here. I get a 118 err code if I try to connect to a manual conf.
benji
Posts: 17
Joined: Fri Oct 14, 2005 2:41 pm

Solution

Post by benji »

The problem is with the stack size passed to sceNetApctlInit which is called from pspSdkInetInit.

The PSPSDK currently uses 0x1400, but a minimum of 0x1600 appears to be needed (this is from experimentation on 4.01m33-2).

Your best bet for a work around is to re-implement pspSdkInetInit in your application to look something like this:

Code: Select all

int tweakedInetInit()
{
	u32 retVal;
	
	retVal = sceNetInit(0x20000, 0x20, 0x1000, 0x20, 0x1000);
	if (retVal != 0)
		return retVal;
	
	retVal = sceNetInetInit();
	if (retVal != 0)
		return retVal;
	
	retVal = sceNetResolverInit();
	if (retVal != 0)
		return retVal;
	
	retVal = sceNetApctlInit(0x1600, 0x42);
	if (retVal != 0)
		return retVal;
	
	return 0;
}
Note that a rather dated thread claims the loader should automatically do this for us, but it doesn't appear to be the case. The thread in question: http://forums.ps2dev.org/viewtopic.php? ... tapctlinit

benji
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Bumped up to 0x1600 in rev 2432
Post Reply