wg: detach bpf upon destroy as well
bpfattach() is called in wg_clone_create(), but the bpfdetach() is missing from wg_close_destroy(). Add the missing bpfdetach() to avoid leaking both the associated bpf bits as well as the ifnet that bpf will hold a reference to. PR: 276526 MFC after: 3 days
This commit is contained in:
@@ -2876,6 +2876,7 @@ wg_clone_destroy(struct if_clone *ifc, if_t ifp, uint32_t flags)
|
||||
|
||||
if (cred != NULL)
|
||||
crfree(cred);
|
||||
bpfdetach(sc->sc_ifp);
|
||||
if_detach(sc->sc_ifp);
|
||||
if_free(sc->sc_ifp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user