Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Sep 2020 07:52:20 +0200
From:      Michael Tuexen <Michael.Tuexen@lurchi.franken.de>
To:        Doug Hardie <bc979@lafn.org>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Address Differences between UDP and SCTP
Message-ID:  <5FDFA318-A3F3-4BAA-9413-33D0FE961717@lurchi.franken.de>
In-Reply-To: <6DB5BF95-F7D8-4933-8633-644A553E8C75@mail.sermon-archive.info>
References:  <6A9D0A4B-F35C-4012-A868-5450D60EC13B@mail.sermon-archive.info> <7CF5C0CF-A173-4253-9F93-70199578A8F7@lurchi.franken.de> <6DB5BF95-F7D8-4933-8633-644A553E8C75@mail.sermon-archive.info>

next in thread | previous in thread | raw e-mail | index | archive | help
> On 8. Sep 2020, at 02:18, Doug Hardie <bc979@lafn.org> wrote:
>=20
>=20
>> On 7 September 2020, at 13:57, Michael Tuexen =
<michael.tuexen@lurchi.franken.de> wrote:
>>=20
>> 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
>=20
> I used:
>=20
>        optval =3D 1;
>        rc =3D setsockopt (recv_fd, IPPROTO_IPV6, =
SCTP_I_WANT_MAPPED_V4_ADDR,
>                                &optval, sizeof(optval));
>=20
> FreeBSD 12.1.  Result was "Operation not supported"
It is an IPPROTO_SCTP level socket option. So you need to use
       rc =3D setsockopt (recv_fd, IPPROTO_SCTP, =
SCTP_I_WANT_MAPPED_V4_ADDR,
                               &optval, sizeof(optval));

Best regards
Michael
>=20
> -- Doug
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5FDFA318-A3F3-4BAA-9413-33D0FE961717>