Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jun 2009 09:20:31 +0000 (UTC)
From:      Marko Zec <zec@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r194051 - head/sys/netgraph
Message-ID:  <200906120920.n5C9KVIf076212@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zec
Date: Fri Jun 12 09:20:31 2009
New Revision: 194051
URL: http://svn.freebsd.org/changeset/base/194051

Log:
  Assign ng_eiface nodes a netgraph name on instantiation, in a way which
  is consistent with the current behavior of ng_iface, i.e. borrow the
  same naming code from ng_iface.c.
  
  Approved by:	julian (mentor)

Modified:
  head/sys/netgraph/ng_eiface.c

Modified: head/sys/netgraph/ng_eiface.c
==============================================================================
--- head/sys/netgraph/ng_eiface.c	Fri Jun 12 09:08:25 2009	(r194050)
+++ head/sys/netgraph/ng_eiface.c	Fri Jun 12 09:20:31 2009	(r194051)
@@ -387,12 +387,10 @@ ng_eiface_constructor(node_p node)
 	ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
 	ifp->if_flags = (IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST);
 
-#if 0
-	/* Give this node name */
-	bzero(ifname, sizeof(ifname));
-	sprintf(ifname, "if%s", ifp->if_xname);
-	(void)ng_name_node(node, ifname);
-#endif
+	/* Give this node the same name as the interface (if possible) */
+	if (ng_name_node(node, ifp->if_xname) != 0)
+		log(LOG_WARNING, "%s: can't acquire netgraph name\n",
+		    ifp->if_xname);
 
 	/* Attach the interface */
 	ether_ifattach(ifp, eaddr);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906120920.n5C9KVIf076212>