summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_socket.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2012-01-16 12:31:33 +0000
committerglebius <glebius@FreeBSD.org>2012-01-16 12:31:33 +0000
commit6541877ebc1b813f4ff85f8d3bb652c024492440 (patch)
tree77e25d68f9478d44266e43dabe10901b1f50ef7c /sys/netgraph/ng_socket.c
parent8b387a2d35f960b0b880a2b1863250d6a9b4d692 (diff)
downloadFreeBSD-src-6541877ebc1b813f4ff85f8d3bb652c024492440.zip
FreeBSD-src-6541877ebc1b813f4ff85f8d3bb652c024492440.tar.gz
Remove some disabled NOTYET code. Probability of enabling it is low,
if anyone wants, he/she can take it from svn.
Diffstat (limited to 'sys/netgraph/ng_socket.c')
-rw-r--r--sys/netgraph/ng_socket.c78
1 files changed, 0 insertions, 78 deletions
diff --git a/sys/netgraph/ng_socket.c b/sys/netgraph/ng_socket.c
index d2053e3..d53787f 100644
--- a/sys/netgraph/ng_socket.c
+++ b/sys/netgraph/ng_socket.c
@@ -64,9 +64,6 @@
#include <sys/socketvar.h>
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
-#ifdef NOTYET
-#include <sys/vnode.h>
-#endif
#include <net/vnet.h>
@@ -124,9 +121,6 @@ static int ng_attach_cntl(struct socket *so);
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, struct mbuf *m, struct sockaddr *addr,
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.
*/
OpenPOWER on IntegriCloud