Correctly type sctp_assoc_id [Was: [erlang-patches] SCTP improvements]

Simon Cornish <>
Wed Dec 16 19:38:22 CET 2009


Hi Raimo,

On Wed, Dec 16, 2009 at 4:42 AM, Raimo Niskanen
raimo+erlang-patches-at-erix.ericsson.se wrote:
> http://github.com/erlang/otp/commit/2666b68aab2167266f49b462e3ed63e6f2045709
> Correctly type sctp_assoc_id as signed, not unsigned
>
> Your patch seems to fix a bug when the returned
> assoc_id from gen_sctp is later rejected by gen_sctp.

Correct.

> The patch would work, but I would rather change
> what inet_drv returns. Something like this:
[...]

I have no preference as to the implementation of a solution. At the
user level, the assoc_id should be considered almost opaque; I say
"almost" because of the special zero value.

> Motivation:
>
> The Sockets API Extensions for SCTP draft tries very
> hard not to specify any signedness for sctp_assoc_t,
> as you say the only defined value is 0, and that in
> fact is the only clue I find that is an integral type.

Yes, this has been a source of comment/frustration/argument since
many-to-one was introduced.

> You could if so inclined interpret it to be a struct

Unfortunately the draft suggests this also.

[...]

> Can you rework that patch too, please?

Actually, since you're the maintainer and either change is simply a
couple of lines, wouldn't it be better for you to introduce the
preferred solution directly into the ccase or pu branch?

Regards,
 Simon


More information about the erlang-patches mailing list