Address Differences between UDP and SCTP

Michael Tuexen Michael.Tuexen at lurchi.franken.de
Tue Sep 8 05:52:25 UTC 2020


> On 8. Sep 2020, at 02:18, Doug Hardie <bc979 at lafn.org> wrote:
> 
> 
>> On 7 September 2020, at 13:57, Michael Tuexen <michael.tuexen at lurchi.franken.de> wrote:
>> 
>> For UDP and TCP you always get IPv6 addresses on AF_INET6 sockets. If you are actually using IPv4, IPv4-mapped IPv6 addresses are used. For SCTP you an choose if you want IPv4-mapped IPv6 addresses or IPv4 address. It is controlled by
>> the socket option specified in https://tools.ietf.org/html/rfc6458#section-8.1.15
> 
> I used:
> 
>        optval = 1;
>        rc = setsockopt (recv_fd, IPPROTO_IPV6, SCTP_I_WANT_MAPPED_V4_ADDR,
>                                &optval, sizeof(optval));
> 
> FreeBSD 12.1.  Result was "Operation not supported"
It is an IPPROTO_SCTP level socket option. So you need to use
       rc = setsockopt (recv_fd, IPPROTO_SCTP, SCTP_I_WANT_MAPPED_V4_ADDR,
                               &optval, sizeof(optval));

Best regards
Michael
> 
> -- Doug
> 



More information about the freebsd-net mailing list