From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25307 invoked by alias); 10 Jan 2008 14:29:28 -0000 Received: (qmail 25299 invoked by uid 22791); 10 Jan 2008 14:29:27 -0000 X-Spam-Check-By: sourceware.org Received: from connor.medar.com (HELO connor.medar.com) (206.181.246.34) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 Jan 2008 14:29:06 +0000 Message-ID: <47862BB1.2030409@weldtechcorp.com> Date: Thu, 10 Jan 2008 14:29:00 -0000 From: Chad Handrich User-Agent: Thunderbird 1.5.0.14pre (X11/20071023) MIME-Version: 1.0 To: ecos-discuss@ecos.sourceware.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] Cannot sendto multicast using FreeBSD stack X-SW-Source: 2008-01/txt/msg00046.txt.bz2 Hello, I wrote about this problem previously, but still have not found a solution (see the subject "Problem with multicast using FreeBSD stack" from 11/29/07) I have eCos configured with the FreeBSD stack. Everything is working except a portion where I have to SEND multicast UDP packets using sendto(). In these instances, sendto() returns -1, and errno == EHOSTUNREACH. Here is my test multicast code that is failing: struct in_addr interface_addr; // eth0 is configured to be 89.89.200.181 inet_aton("89.89.200.181", &interface_addr); setsockopt(skt, IPPROTO_IP, IP_MULTICAST_IF, &interface_addr, sizeof(interface_addr)); struct in_addr multi_iface; getsockopt(skt, IPPROTO_IP, IP_MULTICAST_IF, &multi_iface, sizeof(multi_iface)); diag_printf("getsockopt specifies %s as multicast interface\n", inet_ntoa(multi_iface)); // This outputs the string: getsockopt specifies 89.89.200.181 as multicast interface // Sample data to send via multicast char buf[5]; buf[0] = 0; buf[1] = 1; buf[2] = 2; buf[3] = 3; buf[4] = 4; struct sockaddr_in to; to.sin_family = AF_INET; to.sin_port = htons(2222); inet_aton("239.192.23.160", &(to.sin_addr)); int retval = sendto(skt, buf, 5, 0, (struct sockaddr *)&to, sizeof(to)); diag_printf("post-sendto: errno=%d retval=%d\n", errno, retval); // This outputs the string: post-sendto: errno=365 retval=-1 // errno=365 corresponds to EHOSTUNREACH Any help to get this multicast sendto() to succeed would be greatly appreciated. My thanks, Chad Handrich -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss