I’m seeing some “interesting” behavior in my program’s link-local IPv6 multicast routines. It seems that if I set any of the upper 16 bits of the 112-bit Group ID field, then MacOS/X will no longer accept those multicast packets. My question is, is this a bug in the MacOS/X network stack, or is there some reason why setting the upper 16 bits of the Group ID field would affect routing behavior?
More specific info follows:
-
Multicasting from one Mac to another Mac always works (tested on 10.5 and 10.6)
-
Multicasting from Linux to Windows always works
-
Multicasting from Mac to Windows, or Windows to Mac, or Linux to Mac, only works if the upper 16 bits of the Group ID in the multicast address are set to zero. For example:
- In the “doesn’t work” cases, WireShark running on the Mac shows that the Mac has received the multicast packets, but those packets are never passed on to the receiving application(s) on the Mac. Does this mean that the Mac networking stack has a bug, or is there some deeper magic to multicast addressing that I’m not aware of?
Are you joining the multicast group first? You have to explicitly tell the OS the group that you want to join before it will deliver you a group’s messages. There’s a command you can access with
setsockopt()to join a multicast group. From the Darwin ip6 manpage:I found some example code here:
But maybe you’re doing this already?