Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-1176

SCTP events not handled by inet_sctp

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: inet
    • Labels:
      None

      Description

      Changes for Linux kernel 5.5 in SCTP driver exposes events addr_added, addr_made_prim, addr_removed, send_failed_event
      https://kernelnewbies.org/Linux_5.5#Networking

      Reproduce:
      Starting a SCTP server for instance the one specified in http://erlang.org/doc/man/gen_sctp.html#sctp-examples
      Try to start the client.
      -> Fails with

      {error,{{127,0,0,1},
       2006,[],
       {sctp_paddr_change,{{127,0,0,1},2006},addr_added,0,0}}}

       

      Example:

      2> {ok, Server} = gen_sctp:open().
      {ok,#Port<0.7>}
      3> ok = gen_sctp:listen(Server, true).
      ok
      4> {ok, Port} = inet:port(Server).
      {ok,49542}
      5> 
      5> {ok, Client} = gen_sctp:open().
      {ok,#Port<0.8>}
      6> gen_sctp:connect(Client, "localhost", Port, []).
      {error,{{127,0,0,1},
              49542,[],
              #sctp_paddr_change{addr = {{127,0,0,1},49542},
                                 state = addr_added,error = 0,assoc_id = 0}}}
      7> prim_inet:recvfrom(Client, 0, 1000).
      {ok,{{127,0,0,1},
           49542,[],
           #sctp_paddr_change{addr = {{127,0,0,1},49542},
                              state = addr_made_prim,error = 0,assoc_id = 0}}}
      8> prim_inet:recvfrom(Client, 0, 1000).
      {ok,{{127,0,0,1},
           49542,[],
           #sctp_paddr_change{addr = {{127,0,0,1},49542},
                              state = addr_made_prim,error = 0,assoc_id = 0}}}
      9> prim_inet:recvfrom(Client, 0, 1000).
      {ok,{{127,0,0,1},
           49542,[],
           #sctp_paddr_change{addr = {{192,168,0,3},49542},
                              state = addr_added,error = 0,assoc_id = 0}}}
      10> prim_inet:recvfrom(Client, 0, 1000).
      {ok,{{127,0,0,1},
           49542,[],
           #sctp_paddr_change{addr = {{172,17,0,1},49542},
                              state = addr_added,error = 0,assoc_id = 0}}}
      11> prim_inet:recvfrom(Client, 0, 1000).
      {ok,{{127,0,0,1},
           49542,[],
           #sctp_paddr_change{addr = {{127,0,0,1},49542},
                              state = addr_made_prim,error = 0,assoc_id = 62393}}}
      12> prim_inet:recvfrom(Client, 0, 1000).
      {ok,{{127,0,0,1},
           49542,[],
           #sctp_assoc_change{state = comm_up,error = 0,
                              outbound_streams = 10,inbound_streams = 10,
                              assoc_id = 62393}}}
      

      https://github.com/erlang/otp/blob/master/lib/kernel/src/inet_sctp.erl#L109

        Attachments

          Activity

            People

            Assignee:
            otp_team_ps Team PS
            Reporter:
            sebastiw sebastiw
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: