[Bug 276526] if_wg: Add missing bpfdetach() in wg_clone_destroy()

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 22 Jan 2024 14:26:19 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276526

            Bug ID: 276526
           Summary: if_wg: Add missing bpfdetach() in wg_clone_destroy()
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: aly@aaronly.me

bpfattach() is called in wg_clone_create(), but the bpfdetach() is missing from
wg_close_destroy().  Add the missing bpfdetach().


--- if_wg.c.orig        2024-01-18 21:53:04.264212683 +0800
+++ if_wg.c     2024-01-22 08:20:13.232534082 +0800
@@ -2876,6 +2884,7 @@ wg_clone_destroy(struct if_clone *ifc, i

        if (cred != NULL)
                crfree(cred);
+       bpfdetach(sc->sc_ifp);
        if_detach(sc->sc_ifp);
        if_free(sc->sc_ifp);

-- 
You are receiving this mail because:
You are the assignee for the bug.