1. 20 Nov, 2018 35 commits
  2. 19 Nov, 2018 5 commits
    • David S. Miller's avatar
      Merge branch 'sctp-add-subscribe-per-asoc-and-sockopt-SCTP_EVENT' · cfc6731d
      David S. Miller authored
      Xin Long says:
      
      ====================
      sctp: add subscribe per asoc and sockopt SCTP_EVENT
      
      This patchset mainly adds the Event Subscription sockopt described in
      rfc6525#section-6.2:
      
      "Subscribing to events as described in [RFC6458] uses a setsockopt()
      call with the SCTP_EVENT socket option.  This option takes the
      following structure, which specifies the association, the event type
      (using the same value found in the event type field), and an on/off
      boolean.
      
        struct sctp_event {
          sctp_assoc_t se_assoc_id;
          uint16_t     se_type;
          uint8_t      se_on;
        };
      
      The user fills in the se_type field with the same value found in the
      strreset_type field, i.e., SCTP_STREAM_RESET_EVENT.  The user will
      also fill in the se_assoc_id field with either the association to set
      this event on (this field is ignored for one-to-one style sockets) or
      one of the reserved constant values defined in [RFC6458].  Finally,
      the se_on field is set with a 1 to enable the event or a 0 to disable
      the event."
      
      As for the old SCTP_EVENTS Option with struct sctp_event_subscribe,
      it's being DEPRECATED.
      
      v1->v2:
        - fix some key word in changelog that triggerred the filters at
          vger.kernel.org.
      v2->v3:
        - fix an array out of bounds noticed by Neil in patch 1/4.
      ====================
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cfc6731d
    • Xin Long's avatar
      sctp: add sockopt SCTP_EVENT · 480ba9c1
      Xin Long authored
      This patch adds sockopt SCTP_EVENT described in rfc6525#section-6.2.
      With this sockopt users can subscribe to an event from a specified
      asoc.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      480ba9c1
    • Xin Long's avatar
      sctp: rename enum sctp_event to sctp_event_type · 88ee48c1
      Xin Long authored
      sctp_event is a structure name defined in RFC for sockopt
      SCTP_EVENT. To avoid the conflict, rename it.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      88ee48c1
    • Xin Long's avatar
      sctp: add subscribe per asoc · a1e3a059
      Xin Long authored
      The member subscribe should be per asoc, so that sockopt SCTP_EVENT
      in the next patch can subscribe a event from one asoc only.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a1e3a059
    • Xin Long's avatar
      sctp: define subscribe in sctp_sock as __u16 · 2cc0eeb6
      Xin Long authored
      The member subscribe in sctp_sock is used to indicate to which of
      the events it is subscribed, more like a group of flags. So it's
      better to be defined as __u16 (2 bytpes), instead of struct
      sctp_event_subscribe (13 bytes).
      
      Note that sctp_event_subscribe is an UAPI struct, used on sockopt
      calls, and thus it will not be removed. This patch only changes
      the internal storage of the flags.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2cc0eeb6