• Xin Long's avatar
    sctp: not allow to set asoc prsctp_enable by sockopt · c7051eb3
    Xin Long authored
    [ Upstream commit cc3ccf26f0649089b3a34a2781977755ea36e72c ]
    As rfc7496#section4.5 says about SCTP_PR_SUPPORTED:
       This socket option allows the enabling or disabling of the
       negotiation of PR-SCTP support for future associations.  For existing
       associations, it allows one to query whether or not PR-SCTP support
       was negotiated on a particular association.
    It means only sctp sock's prsctp_enable can be set.
    Note that for the limitation of SCTP_{CURRENT|ALL}_ASSOC, we will
    add it when introducing SCTP_{FUTURE|CURRENT|ALL}_ASSOC for linux
    sctp in another patchset.
      - drop the params.assoc_id check as Neil suggested.
    Fixes: 28aa4c26 ("sctp: add SCTP_PR_SUPPORTED on sctp sockopt")
    Reported-by: default avatarYing Xu <yinxu@redhat.com>
    Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
socket.c 229 KB