From owner-svn-src-head@FreeBSD.ORG Fri Nov 7 19:51:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E55A31065673; Fri, 7 Nov 2008 19:51:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3E548FC19; Fri, 7 Nov 2008 19:51:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA7Jp7Nl091487; Fri, 7 Nov 2008 19:51:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA7Jp7wu091486; Fri, 7 Nov 2008 19:51:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200811071951.mA7Jp7wu091486@svn.freebsd.org> From: Alexander Motin Date: Fri, 7 Nov 2008 19:51:07 +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: r184752 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 19:51:08 -0000 Author: mav Date: Fri Nov 7 19:51:07 2008 New Revision: 184752 URL: http://svn.freebsd.org/changeset/base/184752 Log: 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. Modified: head/sys/netgraph/ng_tty.c Modified: head/sys/netgraph/ng_tty.c ============================================================================== --- head/sys/netgraph/ng_tty.c Fri Nov 7 17:55:09 2008 (r184751) +++ head/sys/netgraph/ng_tty.c Fri Nov 7 19:51:07 2008 (r184752) @@ -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); }