From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,37ed75ba8ea46b5f X-Google-Attributes: gidfee84,public From: Laurent Deniel Subject: Re: Multicast problem using virtual addresses Date: 1999/06/03 Message-ID: <3756F53B.A076DB6B@worldnet.fr>#1/1 X-Deja-AN: 485422062 Content-Transfer-Encoding: 7bit References: <7j36nr$hus$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@isdnet.net X-Trace: news2.isdnet.net 928445646 17562 195.3.19.147 (3 Jun 1999 21:34:06 GMT) Organization: Home Mime-Version: 1.0 NNTP-Posting-Date: 3 Jun 1999 21:34:06 GMT Newsgroups: comp.unix.osf.osf1 pacr99@my-deja.com wrote: > > We now define our multicast address: > mcastaddr.s_addr=inet_addr(?239.255.0.0?) > > Finally, we try to add the IP addresses to the multicast group using: > mreq.imr_multiaddr=mcastaddr; > mreq.imr_interface.s_addr = ipnumber; (ipnumber is a s_addr where > xxx.xxx.xxx.xxx has been stored) > setsockopt(*UDPFD,IPPROTO_IP,IP_ADD_MEMBERSHIP,((const void *) &mreq, > sizeof(mreq)) > > The same is done for the other IP address, zzz.zzz.zzz.zzz (changing > the content of s_addr to zzz.zzz.zzz.zzz) > > The problem is that the last setsockopt returns -1, e.g does not > succeed. The IP address specified in imr_interface is just there to choose the desired interface. AFAIK, you can not become a member of the same multicast group two times on the same interface (i.e. on xxx and zzz when zzz in an alias on the same interface as xxx (but it is possible to join the same group on more than one interface). Laurent. -- Laurent DENIEL | E-mail: deniel@worldnet.fr Paris, FRANCE | deniel@fr.airsysatm.thomson-csf.com | WWW : http://www.worldnet.fr/~deniel All above opinions are personal, unless stated otherwise.