svn commit: r194051 - head/sys/netgraph

Marko Zec zec at FreeBSD.org
Fri Jun 12 09:20:32 UTC 2009


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);


More information about the svn-src-head mailing list