On Mon, Oct 22, 2007 at 12:21:20PM +0000, Daniel Ng wrote: > Hi, > > I'm using uClibc 0.9.28 in a buildroot environment. > > I'm having trouble connecting to a TCP socket. connect() returns -1 with > errno > set to '1' which from looking at the errno include files translates > to 'EPERM'. > > According to the man page for connect(), this means I was trying to either > connect to a broadcast address, or connect() was being blocked by a local > firewall rule. I know I'm not using a broadcast address (it's 127.0.0.1), and > I have no firewalls on my embedded platform. I can connect to the telnet > server using the standard linux telnet client. Changing the FD flags makes no > difference. > > Any suggestions would be most helpful, short of upgrading uClibc. > <snip> > if ( (error = getaddrinfo(hostname, service, &hints, &res)) != 0 )
You're searching for hostname and service in the same call to getaddrinfo. Last time I tried that, the service was ignored, and I switched to using two calls, one for the host and another for the service. See if the output has all the values correct (sin_addr.s_addr and sin_port). -- lfr 0/0
pgplYgQRFtIvw.pgp
Description: PGP signature
_______________________________________________ uClibc mailing list [email protected] http://busybox.net/cgi-bin/mailman/listinfo/uclibc
