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)
This commit is contained in:
Luiz Otavio O Souza 2018-08-15 13:42:22 +00:00
parent daa5b12a0a
commit 02fd7b50a0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=337844

View File

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