Use getsock_cap() instead of deprecated fgetsock().
Reviewed by: tuexen
This commit is contained in:
parent
b632b00087
commit
0f7ddf91e9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312079
@ -121,17 +121,18 @@ sys_sctp_peeloff(td, uap)
|
||||
} */ *uap;
|
||||
{
|
||||
#if (defined(INET) || defined(INET6)) && defined(SCTP)
|
||||
struct file *nfp = NULL;
|
||||
struct file *headfp, *nfp = NULL;
|
||||
struct socket *head, *so;
|
||||
cap_rights_t rights;
|
||||
u_int fflag;
|
||||
int error, fd;
|
||||
|
||||
AUDIT_ARG_FD(uap->sd);
|
||||
error = fgetsock(td, uap->sd, cap_rights_init(&rights, CAP_PEELOFF),
|
||||
&head, &fflag);
|
||||
error = getsock_cap(td, uap->sd, cap_rights_init(&rights, CAP_PEELOFF),
|
||||
&headfp, &fflag, NULL);
|
||||
if (error != 0)
|
||||
goto done2;
|
||||
head = headfp->f_data;
|
||||
if (head->so_proto->pr_protocol != IPPROTO_SCTP) {
|
||||
error = EOPNOTSUPP;
|
||||
goto done;
|
||||
@ -196,7 +197,7 @@ sys_sctp_peeloff(td, uap)
|
||||
done:
|
||||
if (nfp != NULL)
|
||||
fdrop(nfp, td);
|
||||
fputsock(head);
|
||||
fdrop(headfp, td);
|
||||
done2:
|
||||
return (error);
|
||||
#else /* SCTP */
|
||||
|
Loading…
Reference in New Issue
Block a user