Bug 228831 - netstat -Aan -M no longer reads from the corefile
Summary: netstat -Aan -M no longer reads from the corefile
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-net (Nobody)
Keywords: regression
Depends on:
Reported: 2018-06-08 16:55 UTC by Jonathan T. Looney
Modified: 2018-08-29 20:13 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan T. Looney freebsd_committer 2018-06-08 16:55:53 UTC
You should be able to run 'netstat' against a corefile using the -M option. This lets you do things such as display the TCP connections (and the addresses of their associated control blocks).

In FreeBSD-CURRENT, if you run 'netstat -Aan -M <corefile>', it will return output. However, the output is taken from the running system, rather than the coredump. I believe there is no warning that this is the case.

We need to either:
(a) Restore the old behavior (preferred), or
(b) Return an error when a user tries to read from a corefile.
Comment 1 Mike Karels freebsd_committer 2018-08-05 19:41:52 UTC
This functionality was broken by r315662 (Hide struct inpcb, struct tcpcb from the userland.)  Unfortunately, that change also removed the test of the "live" flag, so it blindly shows connections for the current system rather than from the core file.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2018-08-29 20:13:24 UTC
Belatedly notify committer of r315662.