svn commit: r246826 - head/sys/kern

Sergey Kandaurov pluknet at FreeBSD.org
Fri Feb 15 13:00:21 UTC 2013


Author: pluknet
Date: Fri Feb 15 13:00:20 2013
New Revision: 246826
URL: http://svnweb.freebsd.org/changeset/base/246826

Log:
  Add support of passing SCM_BINTIME ancillary data object for PF_LOCAL
  sockets.
  
  PR:		kern/175883
  Submitted by:	Andrey Simonenko <simon at comsys.ntu-kpi.kiev.ua>
  Discussed with:	glebius, phk
  MFC after:	2 weeks

Modified:
  head/sys/kern/uipc_usrreq.c

Modified: head/sys/kern/uipc_usrreq.c
==============================================================================
--- head/sys/kern/uipc_usrreq.c	Fri Feb 15 12:35:16 2013	(r246825)
+++ head/sys/kern/uipc_usrreq.c	Fri Feb 15 13:00:20 2013	(r246826)
@@ -1798,6 +1798,7 @@ unp_internalize(struct mbuf **controlp, 
 	struct mbuf *control = *controlp;
 	struct proc *p = td->td_proc;
 	struct filedesc *fdescp = p->p_fd;
+	struct bintime *bt;
 	struct cmsghdr *cm = mtod(control, struct cmsghdr *);
 	struct cmsgcred *cmcred;
 	struct file **rp;
@@ -1906,6 +1907,18 @@ unp_internalize(struct mbuf **controlp, 
 			microtime(tv);
 			break;
 
+		case SCM_BINTIME:
+			*controlp = sbcreatecontrol(NULL, sizeof(*bt),
+			    SCM_BINTIME, SOL_SOCKET);
+			if (*controlp == NULL) {
+				error = ENOBUFS;
+				goto out;
+			}
+			bt = (struct bintime *)
+			    CMSG_DATA(mtod(*controlp, struct cmsghdr *));
+			bintime(bt);
+			break;
+
 		default:
 			error = EINVAL;
 			goto out;


More information about the svn-src-all mailing list