Page MenuHomeFreeBSD

dumpon: Fix unconfiguring netdump with "off" and "/dev/null".
ClosedPublic

Authored by bdrewery on Jul 24 2021, 9:25 PM.

Details

Summary

Netdump has its own configuration tracking such that
ioctl(/dev/null, DIOCSKERNELDUMP) does a dumper_remove() but does not
notify netdump about the removal. Simply sending the same ioctl to
/dev/netdump handles the situation.

Sponsored by: Dell EMC

Test Plan

Before:

# obj/dumpon -v -k pubkey -s 10.10.0.5 -c 10.10.0.7 -g 10.10.0.1 igb0
kernel dumps on priority: device
0: igb0
server address: 10.10.0.5
client address: 10.10.0.7
gateway address: 10.10.0.1

# obj/dumpon -v off
kernel dumps on priority: device
0: /dev/null
server address: 10.10.0.5
client address: 10.10.0.7
gateway address: 10.10.0.1

# With -r and netdump params to trigger the dumpon ioctl to /dev/netdump
# obj/dumpon -r -v -k pubkey -s 10.10.0.5 -c 10.10.0.7 -g 10.10.0.1 igb0
kernel dumps on priority: device
0: /dev/null

Fixed:

# obj/dumpon -v -k pubkey -s 10.10.0.5 -c 10.10.0.7 -g 10.10.0.1 igb0
kernel dumps on priority: device
0: igb0
server address: 10.10.0.5
client address: 10.10.0.7
gateway address: 10.10.0.1
# obj/dumpon -v ada3p3
kernel dumps on priority: device
0: igb0
1: ada3p3
server address: 10.10.0.5
client address: 10.10.0.7
gateway address: 10.10.0.1
# obj/dumpon -v ada3p3
kernel dumps on priority: device
0: igb0
1: ada3p3
2: ada3p3
server address: 10.10.0.5
client address: 10.10.0.7
gateway address: 10.10.0.1
# obj/dumpon -v -k pubkey -s 11.10.0.5 -c 11.10.0.7 -g 11.10.0.1 igb0
kernel dumps on priority: device
0: igb0
1: ada3p3
2: ada3p3
3: igb0
4: igb0
server address: 11.10.0.5
client address: 11.10.0.7
gateway address: 11.10.0.1
# obj/dumpon -lv
kernel dumps on priority: device
0: igb0
1: ada3p3
2: ada3p3
3: igb0
4: igb0
server address: 11.10.0.5
client address: 11.10.0.7
gateway address: 11.10.0.1
# [-l only showing the last configuration is a separate issue]

# obj/dumpon -v off
kernel dumps on priority: device
0: /dev/null

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.