Page MenuHomeFreeBSD

netdump: check the support status of the interface
ClosedPublic

Authored by mhorne on May 12 2022, 3:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 31, 12:16 AM
Unknown Object (File)
Sat, Mar 30, 11:48 PM
Unknown Object (File)
Jan 23 2024, 3:13 AM
Unknown Object (File)
Jan 13 2024, 7:20 PM
Unknown Object (File)
Jan 2 2024, 4:23 PM
Unknown Object (File)
Dec 16 2023, 3:22 AM
Unknown Object (File)
Dec 13 2023, 8:31 AM
Unknown Object (File)
Dec 4 2023, 5:42 AM

Details

Summary

If the interface does not support debugnet we should bail early, rather
than having the user find this out at the time of the panic. dumpon(8)
already expects this return value and will print a helpful error message.

Test Plan

With this patch:

# dumpon -s 192.168.1.107 -c 192.168.1.112 dwc0
dumpon: Unable to configure netdump because the interface driver does not yet support netdump.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Seems very reasonable to me. Thanks!

This revision is now accepted and ready to land.May 12 2022, 3:54 PM

Hmmm I note that dumpon(8) also expects to receive ENXIO if the interface is not up, so we could add that check here too.

The question becomes: should we deny attempts to configure netdump on a downed interface that might later be brought up? I don't think there's anything to prevent the reverse. Most likely I will just leave it.

Hmmm I note that dumpon(8) also expects to receive ENXIO if the interface is not up, so we could add that check here too.

Where do we do that today? I see the ENXIO check in dumpon but can't see the corresponding IFF_UP check in the kernel.

The question becomes: should we deny attempts to configure netdump on a downed interface that might later be brought up? I don't think there's anything to prevent the reverse. Most likely I will just leave it.

Yes I think it's better to be permissive and assume the user knows what they're doing here. Maybe it'd be appropriate for dumpon(8) to print a warning in that case.

Hmmm I note that dumpon(8) also expects to receive ENXIO if the interface is not up, so we could add that check here too.

Where do we do that today? I see the ENXIO check in dumpon but can't see the corresponding IFF_UP check in the kernel.

In debugnet_connect() we check the IFF_UP flag. Obviously, failing the check at that point means we cannot continue.

The question becomes: should we deny attempts to configure netdump on a downed interface that might later be brought up? I don't think there's anything to prevent the reverse. Most likely I will just leave it.

Yes I think it's better to be permissive and assume the user knows what they're doing here. Maybe it'd be appropriate for dumpon(8) to print a warning in that case.

If this is fairly trivial to implement I will do it.