From ab15d8039eb1bed48f07136aef79fb6893bb920c Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Fri, 15 Feb 2013 13:00:20 +0000 Subject: [PATCH] Add support of passing SCM_BINTIME ancillary data object for PF_LOCAL sockets. PR: kern/175883 Submitted by: Andrey Simonenko Discussed with: glebius, phk MFC after: 2 weeks --- sys/kern/uipc_usrreq.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index c732c7004df2..a6c308f80fbc 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1798,6 +1798,7 @@ unp_internalize(struct mbuf **controlp, struct thread *td) 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, struct thread *td) 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;