* [9fans] multicast
@ 2014-10-06 15:41 Steve Simon
2015-05-24 17:03 ` Jeff Sickel
0 siblings, 1 reply; 4+ messages in thread
From: Steve Simon @ 2014-10-06 15:41 UTC (permalink / raw)
To: 9fans
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [9fans] multicast
2014-10-06 15:41 [9fans] multicast Steve Simon
@ 2015-05-24 17:03 ` Jeff Sickel
0 siblings, 0 replies; 4+ messages in thread
From: Jeff Sickel @ 2015-05-24 17:03 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
Steve,
Did you ever figure out how to setup addmulti?
-jas
> On Oct 6, 2014, at 10:41 AM, Steve Simon <steve@quintile.net> 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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [9fans] Multicast
2012-12-24 19:06 [9fans] Multicast Adriano Verardo
@ 2012-12-24 19:49 ` erik quanstrom
0 siblings, 0 replies; 4+ messages in thread
From: erik quanstrom @ 2012-12-24 19:49 UTC (permalink / raw)
To: 9fans
On Mon Dec 24 14:12:52 EST 2012, adriano.verardo@mail.com wrote:
> Hi, all I need to define a unicast group to implement an application
> on a set of cooperative CPUs. The ip(3) man page is (for me) not
> clear enough and searching for "multicast" etc in /sys/src/*/*/...
> doesn't give any useful result. The same looking in sources/contrib
>
> Where can I find an example on how to exchange multicast packets among
> CPUs wired to the same ethernet switch ?
this isn't something i've ever done, but having fiddled quite a bit in the
network stack, and with drivers, so...
in any case, you will need to add muticast addresses to the hw interfaces.
assuming ethernet, ether(3) has the correct information. if you want to
associate that mc address with a name, you'll need to edit your ndb files
to have sys=name ether=mcaddress.
if the protocol you're using is ip, you'll need to also need to bind in an
ip mc address. using ipconfig(8) is generally easiest. i don't see any reason
why you can't add it in like a non-mc address. you may also wish
to add a dom= line to your ndb file.
- erik
^ permalink raw reply [flat|nested] 4+ messages in thread
* [9fans] Multicast
@ 2012-12-24 19:06 Adriano Verardo
2012-12-24 19:49 ` erik quanstrom
0 siblings, 1 reply; 4+ messages in thread
From: Adriano Verardo @ 2012-12-24 19:06 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
Hi, all
I need to define a unicast group to implement an application on a set of
cooperative CPUs.
The ip(3) man page is (for me) not clear enough and searching for
"multicast" etc in /sys/src/*/*/...
doesn't give any useful result. The same looking in sources/contrib
Where can I find an example on how to exchange multicast packets among
CPUs wired to the
same ethernet switch ?
Thanks in advance
adriano
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-24 17:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-06 15:41 [9fans] multicast Steve Simon
2015-05-24 17:03 ` Jeff Sickel
-- strict thread matches above, loose matches on Subject: below --
2012-12-24 19:06 [9fans] Multicast Adriano Verardo
2012-12-24 19:49 ` erik quanstrom
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).