Link-scope IPv6 Multicast packets suddenly not rou

2020-07-17 06:23发布

This is a slightly obscure question, but I'm stumped and I thought maybe somebody out there might have more of a clue on the issue.

My co-worker has been successfully running an in-house application that uses IPv6 multicasting on his MacBook Pro for several months, but today the Mac decided to stop routing the multicast packets. In particular, the program prints this error:

SendDataUDP(ff02::bead:cede:deed:feed@4) failed on Network interface [Name=[en0] Description=[] IP=[fe80::222:41ff:fe21:dfd4@4] Netmask=[ffff:ffff:ffff:ffff::] Broadcast=[::]] (errno=65/No route to host).

... which pretty well describes what went wrong... it tried to sendto() a UDP packet to the IP address shown, and send() failed with errno=EHOSTUNREACH.

What I don't understand is, what could possibly cause an IPv6 link-scope multicast address to be "unreachable"? If my understanding of link-scope multicast is correct, the packet only has to go out the local ethernet port (en0 in this case, which is up and working on that machine).

Is there some aspect to multicasting that I'm missing, or is his machine just borked? He says he didn't change anything, it just mysteriously stopped working.

2条回答
Bombasti
2楼-- · 2020-07-17 06:40

It might help to look at the kernel source. (In particular, the egress IPv6 packet egress path, ip6_output.c) While you're in there, you could also take a look at the socket calls leading up to it, etc.

For multicast, assuming you're making it to ip6_output(), it looks like the only possible way to get this error is by not specifying the interface to send on. (which is odd since your error message explicitly mentions the interface)

Is it possible that the wireless interface on this MacBook has been enabled when it wasn't before, and now the idea of a "link-local" multicast is ambiguous? Are you explicitly specifying the interface when you use the socket? The @4 at the end of the address looks odd to me. (Is that an interface index?) The convention is usually to use % for an interface scope-id, but as noted in the previous answer and its comments, it's not universally supported.

查看更多
做自己的国王
3楼-- · 2020-07-17 06:52

To test whether en0 is still capable of transmitting link-local multicast requests, try

ping6 ff02::1%en0

This contacts all hosts, so you should get plenty of responses (for fun, try adding -w).

查看更多
登录 后发表回答