Plug parent iface refcount leak on <ifname>.X vlan creation.

PR:		kern/242270
Submitted by:	Andrew Boyer <aboyer at pensando.io>
MFC after:	2 weeks
This commit is contained in:
Alexander V. Chernikov 2020-01-29 18:41:35 +00:00
parent a9d8f71f7b
commit 4be465ab46

View File

@ -963,10 +963,14 @@ vlan_clone_match_ethervid(const char *name, int *vidp)
static int
vlan_clone_match(struct if_clone *ifc, const char *name)
{
struct ifnet *ifp;
const char *cp;
if (vlan_clone_match_ethervid(name, NULL) != NULL)
ifp = vlan_clone_match_ethervid(name, NULL);
if (ifp != NULL) {
if_rele(ifp);
return (1);
}
if (strncmp(vlanname, name, strlen(vlanname)) != 0)
return (0);