From owner-svn-src-all@FreeBSD.ORG Mon Jan 16 12:31:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C28D106566B; Mon, 16 Jan 2012 12:31:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AA4F8FC1A; Mon, 16 Jan 2012 12:31:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GCVYai034256; Mon, 16 Jan 2012 12:31:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GCVYem034254; Mon, 16 Jan 2012 12:31:34 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201161231.q0GCVYem034254@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 16 Jan 2012 12:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230213 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 12:31:34 -0000 Author: glebius Date: Mon Jan 16 12:31:33 2012 New Revision: 230213 URL: http://svn.freebsd.org/changeset/base/230213 Log: Remove some disabled NOTYET code. Probability of enabling it is low, if anyone wants, he/she can take it from svn. Modified: head/sys/netgraph/ng_socket.c Modified: head/sys/netgraph/ng_socket.c ============================================================================== --- head/sys/netgraph/ng_socket.c Mon Jan 16 11:07:46 2012 (r230212) +++ head/sys/netgraph/ng_socket.c Mon Jan 16 12:31:33 2012 (r230213) @@ -64,9 +64,6 @@ #include #include #include -#ifdef NOTYET -#include -#endif #include @@ -124,9 +121,6 @@ static int ng_attach_cntl(struct socket static int ng_attach_common(struct socket *so, int type); static void ng_detach_common(struct ngpcb *pcbp, int type); static void ng_socket_free_priv(struct ngsock *priv); -#ifdef NOTYET -static int ng_internalize(struct mbuf *m, struct thread *p); -#endif static int ng_connect_data(struct sockaddr *nam, struct ngpcb *pcbp); static int ng_bind(struct sockaddr *nam, struct ngpcb *pcbp); @@ -209,19 +203,10 @@ ngc_send(struct socket *so, int flags, s int len, error = 0; struct ng_apply_info apply; -#ifdef NOTYET - if (control && (error = ng_internalize(control, td))) { - if (pcbp->sockdata == NULL) { - error = ENOTCONN; - goto release; - } - } -#else /* NOTYET */ if (control) { error = EINVAL; goto release; } -#endif /* NOTYET */ /* Require destination as there may be >= 1 hooks on this node. */ if (addr == NULL) { @@ -661,69 +646,6 @@ ng_socket_free_priv(struct ngsock *priv) mtx_unlock(&priv->mtx); } -#ifdef NOTYET -/* - * File descriptors can be passed into an AF_NETGRAPH socket. - * Note, that file descriptors cannot be passed OUT. - * Only character device descriptors are accepted. - * Character devices are useful to connect a graph to a device, - * which after all is the purpose of this whole system. - */ -static int -ng_internalize(struct mbuf *control, struct thread *td) -{ - const struct cmsghdr *cm = mtod(control, const struct cmsghdr *); - struct file *fp; - struct vnode *vn; - int oldfds; - int fd; - - if (cm->cmsg_type != SCM_RIGHTS || cm->cmsg_level != SOL_SOCKET || - cm->cmsg_len != control->m_len) { - TRAP_ERROR; - return (EINVAL); - } - - /* Check there is only one FD. XXX what would more than one signify? */ - oldfds = ((caddr_t)cm + cm->cmsg_len - (caddr_t)data) / sizeof (int); - if (oldfds != 1) { - TRAP_ERROR; - return (EINVAL); - } - - /* Check that the FD given is legit. and change it to a pointer to a - * struct file. */ - fd = CMSG_DATA(cm); - if ((error = fget(td, fd, 0, &fp)) != 0) - return (error); - - /* Depending on what kind of resource it is, act differently. For - * devices, we treat it as a file. For an AF_NETGRAPH socket, - * shortcut straight to the node. */ - switch (fp->f_type) { - case DTYPE_VNODE: - vn = fp->f_data; - if (vn && (vn->v_type == VCHR)) { - /* for a VCHR, actually reference the FILE */ - fhold(fp); - /* XXX then what :) */ - /* how to pass on to other modules? */ - } else { - fdrop(fp, td); - TRAP_ERROR; - return (EINVAL); - } - break; - default: - fdrop(fp, td); - TRAP_ERROR; - return (EINVAL); - } - fdrop(fp, td); - return (0); -} -#endif /* NOTYET */ - /* * Connect the data socket to a named control socket node. */