From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) From: Jeff Sickel In-Reply-To: Date: Sun, 24 May 2015 12:03:07 -0500 Content-Transfer-Encoding: 7bit Message-Id: <263E4319-FAB6-473C-AAE6-378BEC77DAB3@corpus-callosum.com> References: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] multicast Topicbox-Message-UUID: 55041334-ead9-11e9-9d60-3106f5b1d025 Steve, Did you ever figure out how to setup addmulti? -jas > On Oct 6, 2014, at 10:41 AM, Steve Simon wrote: > > I am trying to listen to multicast DNS packets > but when I try to configure the IP interface it fails, > what am I missing? > > I do this (multicast with promiscuous) > > snprint(addr, sizeof(addr), "%s/udp!*!*", Netdir); > if((cfd = announce(addr, dir)) < 0) > sysfatal("%s cannot announce, %r\n", addr); > if(fprint(cfd, "addmulti 224.0.0.251") < 0) > sysfatal("add multicast addr 224.0.0.251 failed, %r"); > > and it dies with 'addmulti for a non multicast address' > > which is caused by this failing: > > /sys/src/9/ip/ipifc.c > > int > ipismulticast(uchar *ip) > { > if(isv4(ip)){ > if(ip[IPv4off] >= 0xe0 && ip[IPv4off] < 0xf0) > return V4; > } > else if(ip[0] == 0xff) > return V6; > return 0; > } > > But 0xe0 is 224 so it should not fail. > > I'am very confused. > > -Steve >