mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
sctp: implement sender-side procedures for SSN/TSN Reset Request Parameter
This patch is to implement Sender-Side Procedures for the SSN/TSN Reset Request Parameter descibed in rfc6525 section 5.1.4. It is also to add sockopt SCTP_RESET_ASSOC in rfc6525 section 6.3.3 for users. Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c56480a1e9
commit
a92ce1a42d
4 changed files with 71 additions and 0 deletions
|
@ -3818,6 +3818,32 @@ out:
|
|||
return retval;
|
||||
}
|
||||
|
||||
static int sctp_setsockopt_reset_assoc(struct sock *sk,
|
||||
char __user *optval,
|
||||
unsigned int optlen)
|
||||
{
|
||||
struct sctp_association *asoc;
|
||||
sctp_assoc_t associd;
|
||||
int retval = -EINVAL;
|
||||
|
||||
if (optlen != sizeof(associd))
|
||||
goto out;
|
||||
|
||||
if (copy_from_user(&associd, optval, optlen)) {
|
||||
retval = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
asoc = sctp_id2assoc(sk, associd);
|
||||
if (!asoc)
|
||||
goto out;
|
||||
|
||||
retval = sctp_send_reset_assoc(asoc);
|
||||
|
||||
out:
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* API 6.2 setsockopt(), getsockopt()
|
||||
*
|
||||
* Applications use setsockopt() and getsockopt() to set or retrieve
|
||||
|
@ -3990,6 +4016,9 @@ static int sctp_setsockopt(struct sock *sk, int level, int optname,
|
|||
case SCTP_RESET_STREAMS:
|
||||
retval = sctp_setsockopt_reset_streams(sk, optval, optlen);
|
||||
break;
|
||||
case SCTP_RESET_ASSOC:
|
||||
retval = sctp_setsockopt_reset_assoc(sk, optval, optlen);
|
||||
break;
|
||||
default:
|
||||
retval = -ENOPROTOOPT;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue