summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_eiface.c
diff options
context:
space:
mode:
authorzec <zec@FreeBSD.org>2009-06-12 09:20:31 +0000
committerzec <zec@FreeBSD.org>2009-06-12 09:20:31 +0000
commit0867d9f94a6eabbc7e10be4b21edcb1438f124f9 (patch)
tree0839811a406b37209b259e778a93183c8753d20f /sys/netgraph/ng_eiface.c
parent77af2ed516696d580997d8847dd6165e94819127 (diff)
downloadFreeBSD-src-0867d9f94a6eabbc7e10be4b21edcb1438f124f9.zip
FreeBSD-src-0867d9f94a6eabbc7e10be4b21edcb1438f124f9.tar.gz
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)
Diffstat (limited to 'sys/netgraph/ng_eiface.c')
-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 5474798..7c89faa 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);
OpenPOWER on IntegriCloud