[erlang-questions] IPv6 mutlicast

Andreas Schultz aschultz@REDACTED
Thu Feb 12 18:21:48 CET 2015


I'm trying to use IPv6 multicast with 17.4. My current naive attempt is
something like this:

1> gen_udp:open(6667, [inet6, binary,{ipv6_v6only, true}, {add_membership, {{16#FF02, 0, 0, 0, 0, 0, 1, 2}, {0,0,0,0,0,0,0,0}}}]).
** exception exit: badarg
     in function  inet6_udp:open/2 (inet6_udp.erl, line 42)

I've looked at the source of the badarg failure and after tracing it
to prim_inet is_sockopt_val, type_opt and type_value I find this:

type_opt_1(add_membership)  -> {ip,ip};
type_opt_1(drop_membership) -> {ip,ip};

type_value_2(ip,{A,B,C,D}) when ?ip(A,B,C,D)          -> true;

It seems that multicast support is only permitted for IPv4 addresses.
However, the documentation claims that add_membership takes inet:ip_address()
as type, which is defined to mean IPv4 and IPv6 addresses.

So, my question is: Is IPv6 multicast supported by 17.4 and how do I
use it?

Dipl. Inform.
Andreas Schultz

More information about the erlang-questions mailing list