1. 17 Apr, 2016 21 commits
  2. 16 Apr, 2016 17 commits
  3. 15 Apr, 2016 2 commits
    • David S. Miller's avatar
      Merge branch 'sctp-diag' · 4e811b1e
      David S. Miller authored
      Xin Long says:
      
      ====================
      sctp: support sctp_diag in kernel
      
      This patchset will add sctp_diag module to implement diag interface on
      sctp in kernel.
      
      For a listening sctp endpoint, we will just dump it's ep info.
      For a sctp connection, we will the assoc info and it's ep info.
      
      The ss dump will looks like:
      
      [iproute2]# ./misc/ss --sctp  -n -l
      State      Recv-Q Send-Q   Local Address:Port       Peer Address:Port
      LISTEN     0      128      172.16.254.254:8888      *:*
      LISTEN     0      5        127.0.0.1:1234           *:*
      LISTEN     0      5        127.0.0.1:1234           *:*
        - ESTAB  0      0        127.0.0.1%lo:1234        127.0.0.1:4321
      LISTEN     0      128      172.16.254.254:8888      *:*
        - ESTAB  0      0        172.16.254.254%eth1:8888 172.16.253.253:8888
        - ESTAB  0      0        172.16.254.254%eth1:8888 172.16.1.1:8888
        - ESTAB  0      0        172.16.254.254%eth1:8888 172.16.1.2:8888
        - ESTAB  0      0        172.16.254.254%eth1:8888 172.16.2.1:8888
        - ESTAB  0      0        172.16.254.254%eth1:8888 172.16.2.2:8888
        - ESTAB  0      0        172.16.254.254%eth1:8888 172.16.3.1:8888
        - ESTAB  0      0        172.16.254.254%eth1:8888 172.16.3.2:8888
      LISTEN     0      0        127.0.0.1:4321           *:*
        - ESTAB  0      0        127.0.0.1%lo:4321        127.0.0.1:1234
      
      The entries with '- ESTAB' are the assocs, some of them may belong to
      the same endpoint. So we will dump the parent endpoint first, like the
      entry with 'LISTEN'. then dump the assocs. ep and assocs entries will
      be dumped in right order so that ss can show them in tree format easily.
      
      Besides, this patchset also simplifies sctp proc codes, cause it has
      some similar codes with sctp diag in sctp transport traversal.
      
      v1->v2:
        1. inet_diag_get_handler needs to return it as const.
        2. merge 5/7 into 2/7 of v1.
      
      v2->v3:
        do some improvements and fixes in patch 1-4, see the details in
        each patch's comment.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4e811b1e
    • Xin Long's avatar
      sctp: fix some rhashtable functions using in sctp proc/diag · 53fa1036
      Xin Long authored
      When rhashtable_walk_init return err, no release function should be
      called, and when rhashtable_walk_start return err, we should only invoke
      rhashtable_walk_exit to release the source.
      
      But now when sctp_transport_walk_start return err, we just call
      rhashtable_walk_stop/exit, and never care about if rhashtable_walk_init
      or start return err, which is so bad.
      
      We will fix it by calling rhashtable_walk_exit if rhashtable_walk_start
      return err in sctp_transport_walk_start, and if sctp_transport_walk_start
      return err, we do not need to call sctp_transport_walk_stop any more.
      
      For sctp proc, we will use 'iter->start_fail' to decide if we will call
      rhashtable_walk_stop/exit.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      53fa1036