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)
Tue, Nov 5, 1:51 PM
Unknown Object (File)
Wed, Oct 16, 7:17 AM
Unknown Object (File)
Tue, Oct 15, 5:26 AM
Unknown Object (File)
Tue, Oct 15, 5:26 AM
Unknown Object (File)
Sun, Oct 13, 5:45 PM
Unknown Object (File)
Thu, Oct 10, 7:42 PM
Unknown Object (File)
Thu, Oct 10, 7:35 AM
Unknown Object (File)
Oct 7 2024, 1:27 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.