Discussion:
sctp & ipv4-mapped ipv6 fix
(too old to reply)
Tyler Retzlaff
2016-02-15 15:21:02 UTC
Permalink
hi,

the attached patch converts sctp to use in6_sin_2_v4mapsin6().

it was kept separate from the previous patch posted since the existing
sctp code seems to be building the mapped address incorrectly.

(hoping to get confirmation here)

the existing code seems to set the incorrect parts of the sin6.sin6_addr
structure (uses the wrong s6_addr offsets).

(1) s6_addr16[2] = 0xffff
(2) bcopy(&sin->sin_addr, &sin6.sin6_addr.s6_addr16[3],
sizeof(sin6.sin6_addr.s6_addr16[3]));

using in6_sin_2_v4mapsin6() should resolve this.

rtr
Robert Swindells
2016-02-15 16:51:37 UTC
Permalink
Post by Tyler Retzlaff
the attached patch converts sctp to use in6_sin_2_v4mapsin6().
it was kept separate from the previous patch posted since the existing
sctp code seems to be building the mapped address incorrectly.
(hoping to get confirmation here)
the existing code seems to set the incorrect parts of the sin6.sin6_addr
structure (uses the wrong s6_addr offsets).
(1) s6_addr16[2] = 0xffff
(2) bcopy(&sin->sin_addr, &sin6.sin6_addr.s6_addr16[3],
sizeof(sin6.sin6_addr.s6_addr16[3]));
using in6_sin_2_v4mapsin6() should resolve this.
Looking at RFC 4291, I would agree that it is using the wrong offsets.

I confess that I had not tried building sctp without INET6 until now,
it doesn't compile at present.

I guess that if all the calls to in6_sin_2_v4mapsin6() were inside
#ifdef INET6 conditional code then adding a reference to netinet6
from netinet is ok.

Robert Swindells



--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Tyler Retzlaff
2016-02-15 18:14:23 UTC
Permalink
Post by Robert Swindells
Looking at RFC 4291, I would agree that it is using the wrong offsets.
I confess that I had not tried building sctp without INET6 until now,
it doesn't compile at present.
I guess that if all the calls to in6_sin_2_v4mapsin6() were inside
#ifdef INET6 conditional code then adding a reference to netinet6
from netinet is ok.
It seems to be what other netinet/<proto> are doing. But you're right
I'll add the #ifdef INET6

Thanks

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Robert Swindells
2016-02-15 18:27:13 UTC
Permalink
Post by Tyler Retzlaff
Post by Robert Swindells
Looking at RFC 4291, I would agree that it is using the wrong offsets.
I confess that I had not tried building sctp without INET6 until now,
it doesn't compile at present.
I guess that if all the calls to in6_sin_2_v4mapsin6() were inside
#ifdef INET6 conditional code then adding a reference to netinet6
from netinet is ok.
It seems to be what other netinet/<proto> are doing. But you're right
I'll add the #ifdef INET6
Maybe just go with the patch you posted for now.

I have made a start on adding #ifdef INET6 to the existing code, I can
have a look at it again after your patch has gone in.

Robert Swindells

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Christos Zoulas
2016-02-15 17:46:14 UTC
Permalink
-=-=-=-=-=-
hi,
the attached patch converts sctp to use in6_sin_2_v4mapsin6().
it was kept separate from the previous patch posted since the existing
sctp code seems to be building the mapped address incorrectly.
(hoping to get confirmation here)
the existing code seems to set the incorrect parts of the sin6.sin6_addr
structure (uses the wrong s6_addr offsets).
(1) s6_addr16[2] = 0xffff
(2) bcopy(&sin->sin_addr, &sin6.sin6_addr.s6_addr16[3],
sizeof(sin6.sin6_addr.s6_addr16[3]));
using in6_sin_2_v4mapsin6() should resolve this.
Go for it.

christos


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...