Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jan 2017 16:54:44 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r312079 - head/sys/netinet
Message-ID:  <201701131654.v0DGsiYX059830@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Fri Jan 13 16:54:44 2017
New Revision: 312079
URL: https://svnweb.freebsd.org/changeset/base/312079

Log:
  Use getsock_cap() instead of deprecated fgetsock().
  
  Reviewed by:	tuexen

Modified:
  head/sys/netinet/sctp_syscalls.c

Modified: head/sys/netinet/sctp_syscalls.c
==============================================================================
--- head/sys/netinet/sctp_syscalls.c	Fri Jan 13 16:46:01 2017	(r312078)
+++ head/sys/netinet/sctp_syscalls.c	Fri Jan 13 16:54:44 2017	(r312079)
@@ -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 @@ noconnection:
 done:
 	if (nfp != NULL)
 		fdrop(nfp, td);
-	fputsock(head);
+	fdrop(headfp, td);
 done2:
 	return (error);
 #else  /* SCTP */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701131654.v0DGsiYX059830>