IPv6 multicast sendto() 'operation not supported'

JINMEI Tatuya /神明達哉 jinmei at isl.rdc.toshiba.co.jp
Thu Feb 26 18:55:00 PST 2004


>>>>> On Thu, 26 Feb 2004 11:27:31 -0500 (EST), 
>>>>> Donald McLachlan <don at mainframe.dgrc.crc.ca> said:

> In preparation for writing an IPv6 multicast application I wrote a little
> test program (shown below).  This program worked on linux (RedHat), but
> when I try it on a FreeBSD box (5.0, running zebra router and pim6dd)
> sendto() fails with "Operation not supported" ... ???

> To verify my app was OK, I installed a solaris box on the LAN beside the
> linux box and the app compiled and worked fine.

> Thinking it might be a bug in 5.0 or an interaction with zebra/pim6dd I
> installed a FreeBSD 5.2 box on the lan beside the other 2 app boxes and
> I get the same error again.  Anyone know what is missing/wrong in my test app?

> [ I'm guessing FreeBSD wants some extra socket options set, but I don't know
>   which ones. ]

Did your code really succeed the bind(2) call in the main function?

> 	bzero((char *)&sin, (int)sizeof(sin));		/* setup address info */
> 	bcopy(the_addr, (char *)&sin.sin6_addr, sizeof(the_addr));
> 	sin.sin6_family = AF_INET6;
> 	sin.sin6_port = htons(3000);
> 							/* bind addr to sock */
> 	if(bind(sock, (struct sockaddr *)&sin, sizeof(sin)) < 0)
> 	{
> 		perror("bind");
> 		exit(errno);
> 	}

FreeBSD should require a valid sin6_len (which should be
sizeof(sockaddr_in6)), so the program should have stopped here.

					JINMEI, Tatuya
					Communication Platform Lab.
					Corporate R&D Center, Toshiba Corp.
					jinmei at isl.rdc.toshiba.co.jp


More information about the freebsd-net mailing list