From: Daniel Ng <daniel_ng11@lycos.com>
To: netdev@vger.kernel.org
Subject: Multicast socket behaviour?
Date: Wed, 13 Aug 2008 08:21:58 +0000 (UTC) [thread overview]
Message-ID: <loom.20080813T082132-707@post.gmane.org> (raw)
Hi,
The below C code registers the socket with the multicast group 'HELLO_GROUP':
mreq.imr_multiaddr.s_addr=inet_addr(HELLO_GROUP);
mreq.imr_address.s_addr=htonl(INADDR_ANY);
mreq.imr_ifindex = if_nametoindex("ppp1");
if (setsockopt(fd,IPPROTO_IP,IP_ADD_MEMBERSHIP,&mreq,sizeof(mreq)) < 0) {
perror("setsockopt");
exit(1);
}
I understand that if 'INADDR_ANY' is used, it is up to the kernel to decide
what action to take.
>From my experiments, it seems that the interface corresponding to the
highest '224.0.0.0' entry in the routing table is used.
Would someone please explain why this is so?
How difficult would it be to have the kernel join the HELLO_GROUP on *all*
available multicast-capable interfaces? Why isn't this currently implemented?
I'm using 2.6.14.
Cheers,
Daniel
next reply other threads:[~2008-08-13 8:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-13 8:21 Daniel Ng [this message]
2008-08-13 11:19 ` Multicast socket behaviour? Neil Horman
2008-08-13 16:12 ` David Stevens
2008-08-14 0:08 ` Daniel Ng
2008-08-14 1:30 ` David Stevens
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20080813T082132-707@post.gmane.org \
--to=daniel_ng11@lycos.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).