]> 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>
Mon, 22 Jan 2024 16:22:44 +0000 (10:22 -0600)
commit43be2d7aaf25b719aec8f49aab110c0061f1edec
tree933b5e0a11c12addc951fdd5931aa0705d89a0c1
parentc19fb1f963e3dc88a82b20d1b17f94a4cd321e74
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
sys/dev/wg/if_wg.c