我看到一些"有趣"的行为在我节目的链接本地IPv6播例行程序。看来,如果我设定任何上16位的112比特组ID领域,那么mac os/X再也不会接受那些多播报。我的问题是,这是一个错误的mac os/X网络叠,或者是有一些原因,设定上的16位的组ID领域将会影响到路由的行为?

更具体的信息如下:

  • 多信道广播从一个Mac到另一个Mac总是工作(上测试10.5和10.6)

  • 多信道广播从Linux窗总是工作

  • 多信道广播从Mac到窗口,或窗户,或Linux,只是工作,如果上有16位的组ID播地址被设置为零。例如:

  • ff02::666工作
  • ff02:0:录::666工作
  • ff02:1::666不工作
  • ff02:8000::666不工作

    • 在"不工作"的情况下,查看上运行Mac显示,Mac已收到的多播报,但这些分组从来没有传递到收到的申请(s)。这是否意味着Mac网络堆有一个错误,或者是有一些的更深的魔法播解决,我不知道的吗?
  • 有帮助吗?

    解决方案

    是你加入的多播组第一次?你必须明确地告诉操作系统的组希望加入之前,它将提供你一个小组的消息。有一个命令你可以访问 setsockopt() 加入一个播组。从 达尔文ip6平:

    IPV6_JOIN_GROUP struct ipv6_mreq *
        Join a multicast group.  A host must become a member of a multicast group before it can receive
        datagrams sent to the group.
    
        struct ipv6_mreq {
                struct in6_addr ipv6mr_multiaddr;
                unsigned int    ipv6mr_interface;
        };
    
        ipv6mr_interface may be set to zeroes to choose the default multicast interface or to the index
        of a particular multicast-capable interface if the host is multihomed.  Membership is associ-
        ated with a single interface; programs running on multihomed hosts may need to join the same
        group on more than one interface.
    
        If the multicast address is unspecified (i.e., all zeroes), messages from all multicast
        addresses will be accepted by this group.  Note that setting to this value requires superuser
        privileges.
    

    我找到一些例子码 在这里,:

    struct ipv6_mreq mreq6;
    memcpy(&mreq6.ipv6mr_multiaddr, &(((struct sockaddr_in6 *)addr)->sin6_addr),
           sizeof(struct in6_addr));
    mreq6.ipv6mr_interface= 0;
    
    err = setsockopt(sockfd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq6, sizeof(mreq6));
    if (err) fprintf(stderr, "setsockopt IPV6_JOIN_GROUP: %s\n", strerror (errno));
    

    但也许你是在做这个了吗?

    许可以下: CC-BY-SA归因
    不隶属于 StackOverflow
    scroll top