HomeFreeBSD

debugnet: fix an errant assertion

Description

debugnet: fix an errant assertion

We may call debugnet_free() before g_debugnet_pcb_inuse is true,
specifically in the cases where the interface is down or does not
support debugnet. pcb->dp_drv_input is used to hold the real driver
if_input callback while debugnet is in use, so we can check the status
of this field in the assertion.

This can be triggered trivially by trying to configure netdump on an
unsupported interface at the ddb prompt.

Initializing the dp_drv_input field to NULL explicitly is not necessary
but helps display the intent.

PR: 263929
Reported by: Martin Filla <freebsd@sysctl.cz>
Reviewed by: cem, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35179

Details

Provenance
mhorneAuthored on May 14 2022, 1:23 PM
Reviewer
cem
Differential Revision
D35179: debugnet: fix an errant assertion
Parents
rG14c99b43ef69: kqueue: Fix kqueue(2) man page.
Branches
Unknown
Tags
Unknown