[ECOS] Problem Establishing socket Connection

kevin_lemay@agilent.com kevin_lemay@agilent.com
Mon Nov 10 20:11:00 GMT 2003


Andrew,

You are right... I should have made the code stub.

It turns out that the FreeBSD stack requires you to fill out the sa_len field of the server address. Your code sample runs with this modification. 

I will go back to my code and see if that fixes my problem....

Thanks,

Kevin

-----Original Message-----
From: Andrew Lunn [mailto:andrew@lunn.ch]
Sent: Monday, November 10, 2003 11:35 AM
To: kevin_lemay@agilent.com
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Problem Establishing socket Connection


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 130.30.174.109 (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.

         Thanks
                Andrew

-- 
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