aboutsummaryrefslogtreecommitdiff
path: root/sys/netgraph
diff options
context:
space:
mode:
authorMarko Zec <zec@FreeBSD.org>2009-06-12 09:20:31 +0000
committerMarko Zec <zec@FreeBSD.org>2009-06-12 09:20:31 +0000
commiteb4261851f1fd98d4fc147e0c934c803fa8f9b03 (patch)
tree0839811a406b37209b259e778a93183c8753d20f /sys/netgraph
parent925b1b25f1d16fd8103b31fb9dbe942689071d7a (diff)
downloadsrc-eb4261851f1fd98d4fc147e0c934c803fa8f9b03.tar.gz
src-eb4261851f1fd98d4fc147e0c934c803fa8f9b03.zip
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)
Notes
Notes: svn path=/head/; revision=194051
Diffstat (limited to 'sys/netgraph')
-rw-r--r--sys/netgraph/ng_eiface.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c
index 5474798dbb5e..7c89faa93a8c 100644
--- a/sys/netgraph/ng_eiface.c
+++ b/sys/netgraph/ng_eiface.c
@@ -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);