[erlang-questions] sctp_peer_addr_params

Raimo Niskanen raimo+erlang-questions@REDACTED
Thu Jan 22 08:53:51 CET 2009

On Wed, Jan 21, 2009 at 07:52:56AM +0100, Mikael Lixenstrand wrote:
> I'm trying to change the sack delay in gen_sctp
>  {ok,Socket} = gen_sctp:open([{ip, ServerIPAddress}, {port, ServerPort}]
>   ++ [{sctp_peer_addr_params, #sctp_paddrparams{ assoc_id = 0, address =
> {ServerIPAddress ,ServerPort} ,sackdelay = 400}},
>   {mode, binary},
>   {active, false},
>   {sctp_events,#sctp_event_subscribe{address_event = false,
> shutdown_event=false}}]),
> I tried several approaches but with the same result:
> Error in process <0.7100.1> on node 'mikael@REDACTED' with exit value:
> {badarg,[{gen_sctp,open,[[{ip,{10,70,160,17}},{port,3868},{sctp_peer_addr_params,{sctp_paddrparams,0,{{10,70,160,17},3868},200,5,600,400,[]}},{mode,binary},{active,false},{sctp_events,{sctp_event_subscribe,undefined,undefined,false,undefined,undefined...
> I'm running R12B-0 on rhel 5.2

Congratulations, you have found a bug!

You have dived down to the untested parts of the SCTP code.
It is still something we have left to do to write thorough
test cases for gen_sctp. Unfortunately there are a _lot_
of options and functionality to test so it is a big task.


The decoding in the inet driver for #sctp_paddrparams{address={IP,P}}
is wrong; it does not expect the address family byte that it gets
and detects a parameter length mismatch.

I had a small patch yesterday, but I could not set default
sctp_peer_addr_params for future associations, so I started
to read the spec, and indeed it should be possible.

So yesterdays 2 character patch of inet_drv.c now is a patch
for erts/configure.in, inet_drv.c and prim_inet.erl. I will
do some more testing and post a patch hopefully during the day.

> Thanks

> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions


/ Raimo Niskanen, Erlang/OTP, Ericsson AB

More information about the erlang-questions mailing list