<p>I got another problem with some settings now that used to work with the unpatched R12B-0 </p><p>{badarg,[{gen_sctp,open,[[{ip,{10,70,128,108}},{mode,binary},{active,false},{sctp_events,{sctp_event_subscribe,undefined,undefined,false,undefined,undefined,false,undefined,undefined}}]]}<br>
</p><p>{sctp_events,#sctp_event_subscribe{address_event = false, shutdown_event=false}</p><p>Not as big problem as before but might be something you are intrested in.</p><div class="gmail_quote">/ Mikael</div><div class="gmail_quote">
</div><div class="gmail_quote"></div><div class="gmail_quote">2009/1/28 Mikael Lixenstrand <span dir="ltr"><<a href="mailto:mikael.lixenstrand@gmail.com">mikael.lixenstrand@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<p>Thank you.</p><p>This helped me a great deal. I had some compilation problems with R12B-5 but when i solved that i worked perfect.<br></p><p>/ Mikael</p><br><div class="gmail_quote">2009/1/22 Raimo Niskanen <span dir="ltr"><<a href="mailto:raimo%2Berlang-questions@erix.ericsson.se" target="_blank">raimo+erlang-questions@erix.ericsson.se</a>></span><div>
<div class="Wj3C7c"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Jan 22, 2009 at 08:53:51AM +0100, Raimo Niskanen wrote:<br>
> On Wed, Jan 21, 2009 at 07:52:56AM +0100, Mikael Lixenstrand wrote:<br>
> > I'm trying to change the sack delay in gen_sctp<br>
> ><br>
> >  {ok,Socket} = gen_sctp:open([{ip, ServerIPAddress}, {port, ServerPort}]<br>
> >   ++ [{sctp_peer_addr_params, #sctp_paddrparams{ assoc_id = 0, address =<br>
> > {ServerIPAddress ,ServerPort} ,sackdelay = 400}},<br>
> >   {mode, binary},<br>
> >   {active, false},<br>
> >   {sctp_events,#sctp_event_subscribe{address_event = false,<br>
> > shutdown_event=false}}]),<br>
> ><br>
> > I tried several approaches but with the same result:<br>
> ><br>
> > Error in process <0.7100.1> on node 'mikael@lambada' with exit value:<br>
> > {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...<br>


> ><br>
> > I'm running R12B-0 on rhel 5.2<br>
> ><br>
><br>
> Congratulations, you have found a bug!<br>
><br>
> You have dived down to the untested parts of the SCTP code.<br>
> It is still something we have left to do to write thorough<br>
> test cases for gen_sctp. Unfortunately there are a _lot_<br>
> of options and functionality to test so it is a big task.<br>
><br>
> Nevertheless..<br>
><br>
> The decoding in the inet driver for #sctp_paddrparams{address={IP,P}}<br>
> is wrong; it does not expect the address family byte that it gets<br>
> and detects a parameter length mismatch.<br>
><br>
> I had a small patch yesterday, but I could not set default<br>
> sctp_peer_addr_params for future associations, so I started<br>
> to read the spec, and indeed it should be possible.<br>
><br>
> So yesterdays 2 character patch of inet_drv.c now is a patch<br>
> for erts/<a href="http://configure.in" target="_blank">configure.in</a>, inet_drv.c and prim_inet.erl. I will<br>
> do some more testing and post a patch hopefully during the day.<br>
<br>
Here is the patch. Unfortunately it is a minimal path for the<br>
current development branch so it will not be applied cleanly<br>
to R12B-5 or any other released source. But applying it manually<br>
should be no problem for the initiated user.<br>
<br>
erts/<a href="http://configure.in" target="_blank">configure.in</a>: Spelling error `ssh_data' -> `ssf_data'<br>
        To do this manually to its autoconf result erts/configure<br>
        change all occurences of `ssh_data' to `ssf_data' while<br>
        preserving case. I have searched and there are<br>
        no false occurences.<br>
<br>
erts/emulator/drivers/common/inet_drv.c:<br>
        Two changes of inet_set_address -> inet_set_faddress.<br>
        A few changes of HAVE_SCTP_* -> HAVE_STRUCT_SCTP_*.<br>
        Use the patch to find the places.<br>
<br>
erts/preloaded/src/prim_inet.erl:<br>
        This file has moved in our development branch;<br>
        I think it was in lib/kernerl/src in R12B-5.<br>
<br>
With these patches it appears to work. Note that it is the<br>
peers address and port you use in the option! To set it<br>
on future associations you must not specify the peer<br>
address or association id. This is now possible thanks<br>
to the prim_inet.erl patch. Without that patch you<br>
could use address={{0,0,0,0},0} and assoc_id=0.<br>
See <a href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13#section-7" target="_blank">http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13#section-7</a><br>
just before section 7.1, and<br>
<a href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13#section-7.1.13" target="_blank">http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13#section-7.1.13</a><br>
<br>
In one erlang shell:<br>
<br>
Erlang R13A (erts-5.7) [64-bit] [smp:4] [async-threads:0] [kernel-poll:false]<br>
<br>
Eshell V5.7  (abort with ^G)<br>
1> gen_sctp:open([{ip,loopback}]).<br>
{ok,#Port<0.444>}<br>
2> {ok,S} = v(-1).<br>
{ok,#Port<0.444>}<br>
3> gen_sctp:listen(S, true).<br>
ok<br>
4> inet:port(S).<br>
{ok,32850}<br>
<br>
And then the action in another erlang shell:<br>
<br>
Erlang R13A (erts-5.7) [64-bit] [smp:4] [async-threads:0] [kernel-poll:false]<br>
<br>
Eshell V5.7  (abort with ^G)<br>
1> rr(inet).<br>
[connect_opts,hostent,listen_opts,sctp_adaptation_event,<br>
 sctp_assoc_change,sctp_assoc_value,sctp_assocparams,<br>
 sctp_event_subscribe,sctp_initmsg,sctp_opts,<br>
 sctp_paddr_change,sctp_paddrinfo,sctp_paddrparams,<br>
 sctp_pdapi_event,sctp_prim,sctp_remote_error,sctp_rtoinfo,<br>
 sctp_send_failed,sctp_setadaptation,sctp_setpeerprim,<br>
 sctp_shutdown_event,sctp_sndrcvinfo,sctp_status,udp_opts]<br>
2> {ok,S} = gen_sctp:open([{sctp_peer_addr_params, #sctp_paddrparams{sackdelay=400,flags=[sackdelay_enable]}}]).<br>
{ok,#Port<0.456>}<br>
3> gen_sctp:connect(S, localhost, 32850, []).<br>
{ok,#sctp_assoc_change{state = comm_up,error = 0,<br>
                       outbound_streams = 10,inbound_streams = 10,<br>
                       assoc_id = 1}}<br>
4> inet:setopts(S, [{sctp_peer_addr_params, #sctp_paddrparams{sackdelay=500,flags=[sackdelay_enable],assoc_id=1,address={loopback,32850}}}]).<br>
ok<br>
5> inet:getopts(S, [sctp_peer_addr_params]).<br>
{ok,[{sctp_peer_addr_params,<br>
         #sctp_paddrparams{<br>
             assoc_id = 0,<br>
             address = {{0,0,0,0},0},<br>
             hbinterval = 30000,pathmaxrxt = 5,pathmtu = 0,<br>
             sackdelay = 400,<br>
             flags = [hb_enable,pmtud_enable,sackdelay_enable]}}]}<br>
6> inet:getopts(S, [{sctp_peer_addr_params, #sctp_paddrparams{assoc_id=1,address={loopback,32850}}}]).<br>
{ok,[{sctp_peer_addr_params,<br>
         #sctp_paddrparams{<br>
             assoc_id = 1,<br>
             address = {{127,0,0,1},32850},<br>
             hbinterval = 30000,pathmaxrxt = 5,pathmtu = 16436,<br>
             sackdelay = 500,<br>
             flags = [hb_enable,pmtud_enable,sackdelay_enable]}}]}<br>
<br>
<br>
><br>
> > Thanks<br>
><br>
> > _______________________________________________<br>
> > erlang-questions mailing list<br>
> > <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
> > <a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
><br>
> --<br>
><br>
> / Raimo Niskanen, Erlang/OTP, Ericsson AB<br>
> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
> <a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
<font color="#888888"><br>
--<br>
<br>
/ Raimo Niskanen, Erlang/OTP, Ericsson AB<br>
</font></blockquote></div></div></div><br>
</blockquote></div><br>