[ECOS] Problem Establishing socket Connection

Andrew Lunn andrew@lunn.ch
Mon Nov 10 19:34:00 GMT 2003

On Mon, Nov 10, 2003 at 11:12:30AM -0700, kevin_lemay@agilent.com wrote:

> I am trying to port some working vxWorks code over the eCos. This
> includes some standard BSD socket connections.

> I am encountering a problem within eCos. It has decided that I am
> trying to establish a network connection to a multicast socket,
> which is not the case.
> We are attempting to connect to (x821eae6d), port 5678.
> I am using the CVS version of eCos as of Friday on an i386 platform.

It always a good idea to post a complete (none)working test
case. Something we can just compile and run. It saves us time messing
turning your code fragment into something useful.

I've attached what i used to test this.

> The error occurs in tcp_usrrec.c at line 341
>  	336		/*
>  	337		 * Must disallow TCP ``connections'' to multicast addresses.
>  	338		 */
>  	339		sinp = (struct sockaddr_in *)nam;
> -	340		if (sinp->sin_family == AF_INET
> -	341		    && IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) {
> -	342			error = EAFNOSUPPORT;
> -	343			goto out;
>  	344		}

I get another error. EINVAL. I didn't track it down, but these seems
much more reasonable to me than EAFNOSUPPORT.

Please try to reproduce your problem either using my code, or build a
complete test case which demonstrates the problem.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 2118 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/ecos-discuss/attachments/20031110/7894948d/attachment.bin>
-------------- next part --------------
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

More information about the Ecos-discuss mailing list