OSDN Git Service

sctp: not allow to set asoc prsctp_enable by sockopt
authorXin Long <lucien.xin@gmail.com>
Sun, 18 Nov 2018 07:21:53 +0000 (15:21 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 19 Nov 2018 20:41:18 +0000 (12:41 -0800)
commitcc3ccf26f0649089b3a34a2781977755ea36e72c
tree84659cbe7685c7a35cd830896298609483629d56
parent02968ccf0125d39b08ecef5946300a8a873c0942
sctp: not allow to set asoc prsctp_enable by sockopt

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.

v1->v2:
  - drop the params.assoc_id check as Neil suggested.

Fixes: 28aa4c26fce2 ("sctp: add SCTP_PR_SUPPORTED on sctp sockopt")
Reported-by: Ying Xu <yinxu@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/socket.c