]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
wg: detach bpf upon destroy as well
authorAaron LI <aly@aaronly.me>
Mon, 22 Jan 2024 16:18:56 +0000 (10:18 -0600)
committerKyle Evans <kevans@FreeBSD.org>
Tue, 30 Jan 2024 05:38:01 +0000 (23:38 -0600)
commit3deeb70f7f70e5fbabde85efc7ea603cde915f6a
treea2ef9a78b8a963c42723f815c49d2b0750e25f39
parentce2d249b207045f27ec03719997168c92d0f6104
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 43be2d7aaf25b719aec8f49aab110c0061f1edec)
sys/dev/wg/if_wg.c