mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 02:42:46 +00:00
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
(cherry picked from commit 43be2d7aaf
)
This commit is contained in:
parent
ce2d249b20
commit
3deeb70f7f
@ -2876,6 +2876,7 @@ wg_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
|
||||
|
||||
if (cred != NULL)
|
||||
crfree(cred);
|
||||
bpfdetach(sc->sc_ifp);
|
||||
if_detach(sc->sc_ifp);
|
||||
if_free(sc->sc_ifp);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user