Subject: Re: regression: bind interface and transmit to ff02::2
To: None <tech-net@netbsd.org>
From: David Young <dyoung@pobox.com>
List: tech-net
Date: 03/23/2006 00:51:50
On Thu, Mar 23, 2006 at 03:45:20PM +0900, JINMEI Tatuya / ?$B?@L@C#:H wrote:
> >>>>> On Wed, 22 Mar 2006 23:57:17 -0600, 
> >>>>> David Young <dyoung@pobox.com> said:
> 
> > The kernel used to let me bind(2) to an IPv6 interface---e.g., [sin6_addr
> > fe80::200:24ff:fec3:4bac sin6_scope_id 1]---and sendto(2) the destination
> > [sin6_addr ff02::2 sin6_scope_id 0].  I cannot do that any longer.  Now,
> > sendto exits with EHOSTUNREACH.
> 
> > I would expect sendto to fail if I hadn't bound the interface and/or set
> > the multicast interface with setsockopt(,IPPROTO_IPV6,IPV6_MULTICAST_IF,),
> > but I have done both.  The new behavior seems like a regression to me.
> 
> Do you mean the following pseudo code failed?
> 
> 	s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
> 	bind(s, fe80::200:24ff:fec3:4bac%1);
> 	setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_IF, 1);
> 	sendto(s, buf, buflen, 0, ff02::2%0, sizeof(sockaddr_in6));

Correct.

Dave

-- 
David Young             OJC Technologies
dyoung@ojctech.com      Urbana, IL * (217) 278-3933