From 02fd7b50a0ab9f8a16782b05ad1d8f6694fa9b9b Mon Sep 17 00:00:00 2001 From: Luiz Otavio O Souza Date: Wed, 15 Aug 2018 13:42:22 +0000 Subject: [PATCH] The interface name must be sanitized before the search to match the existing netgraph node. Fixes the search (and use) of VLANs with dot notation. Obtained from: pfSense Sponsored by: Rubicon Communications, LLC (Netgate) --- sys/netgraph/ng_ether.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index c023b0d3d5e6..575f3740a6f1 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -314,7 +314,8 @@ ng_ether_attach(struct ifnet *ifp) * eiface nodes, which may be problematic due to naming * clashes. */ - if ((node = ng_name2noderef(NULL, ifp->if_xname)) != NULL) { + ng_ether_sanitize_ifname(ifp->if_xname, name); + if ((node = ng_name2noderef(NULL, name)) != NULL) { NG_NODE_UNREF(node); return; } @@ -341,7 +342,6 @@ ng_ether_attach(struct ifnet *ifp) priv->hwassist = ifp->if_hwassist; /* Try to give the node the same name as the interface */ - ng_ether_sanitize_ifname(ifp->if_xname, name); if (ng_name_node(node, name) != 0) log(LOG_WARNING, "%s: can't name node %s\n", __func__, name); }