summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
diff options
context:
space:
mode:
authorloos <loos@FreeBSD.org>2018-08-15 13:42:22 +0000
committerLuiz Souza <luiz@netgate.com>2018-08-17 15:07:26 -0300
commite6acecb83e8c48d0f0ecd3f26b4ebb77edd9c4dc (patch)
tree358c02bd0e34c0d84746328f3304db72b2c72cbb /sys/netgraph
parent7bb6999b14af77ce661707e690076af413796b6a (diff)
downloadFreeBSD-src-e6acecb83e8c48d0f0ecd3f26b4ebb77edd9c4dc.zip
FreeBSD-src-e6acecb83e8c48d0f0ecd3f26b4ebb77edd9c4dc.tar.gz
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) (cherry picked from commit 81979a6755f342a76754a21e9530630abfdb11b1)
Diffstat (limited to 'sys/netgraph')
-rw-r--r--sys/netgraph/ng_ether.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c
index 42c4f0e..6eed9ca 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);
}
OpenPOWER on IntegriCloud