我无法接收服务器发送的多播数据包。我可以看到通过 tcpdump 接收到的数据包。谁能让我知道我在这里做错了什么。谢谢。
struct ipv6_mreq mreq;
struct sockaddr_in6 servaddr;
sock = socket(AF_INET6,SOCK_DGRAM,0);
servaddr.sin6_family = AF_INET6;
servaddr.sin6_port = htons(61624);
servaddr.sin6_addr = in6addr_any;
inet_pton(AF_INET6,"ff38:40:2001::1",&mreq.ipv6mr_multiaddr);
mreq.ipv6mr_interface = 0;
setsockopt(sock,IPPROTO_IPV6,IPV6_JOIN_GROUP, &mreq,sizeof(mreq));
bind(sock,(struct sockaddr *)&servaddr,sizeof(servaddr));
/* using poll to receive data */