summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2008-11-07 19:51:07 +0000
committermav <mav@FreeBSD.org>2008-11-07 19:51:07 +0000
commit5eabda5fe7c1f3a7116450176c2fd5c0a26b3d33 (patch)
tree7f750bfa3ca37e9365a376fea3b3f21d4c86639a
parent6b691ca72e27ce73e2b774ada6d6c993db135ba4 (diff)
downloadFreeBSD-src-5eabda5fe7c1f3a7116450176c2fd5c0a26b3d33.zip
FreeBSD-src-5eabda5fe7c1f3a7116450176c2fd5c0a26b3d33.tar.gz
Don't assign completely meaningless name to the node on creation.
As soon as node is created from the netgraph side now, it can be found without using this. Allow application to assign whatever name it want later.
-rw-r--r--sys/netgraph/ng_tty.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c
index 7616489..5cab971 100644
--- a/sys/netgraph/ng_tty.c
+++ b/sys/netgraph/ng_tty.c
@@ -94,8 +94,6 @@ struct ngt_softc {
};
typedef struct ngt_softc *sc_p;
-static int ngt_unit;
-
/* Flags */
#define FLG_DEBUG 0x0002
@@ -157,7 +155,6 @@ static int
ngt_constructor(node_p node)
{
sc_p sc;
- char name[sizeof(NG_TTY_NODE_TYPE) + 8];
/* Allocate private structure */
sc = malloc(sizeof(*sc), M_NETGRAPH, M_NOWAIT | M_ZERO);
@@ -170,14 +167,6 @@ ngt_constructor(node_p node)
mtx_init(&sc->outq.ifq_mtx, "ng_tty node+queue", NULL, MTX_DEF);
IFQ_SET_MAXLEN(&sc->outq, IFQ_MAXLEN);
- atomic_add_int(&ngt_unit, 1);
- snprintf(name, sizeof(name), "%s%d", typestruct.name, ngt_unit);
-
- /* Assign node its name */
- if (ng_name_node(node, name))
- log(LOG_WARNING, "%s: can't name node %s\n",
- __func__, name);
- /* Done */
return (0);
}
OpenPOWER on IntegriCloud