On Mon, Nov 23, 2015 at 04:24:39PM +0000, Stuart Henderson wrote:
> On 2015/11/23 10:53, David Hill wrote:
> > On Fri, Nov 20, 2015 at 12:07:36PM -0500, David Hill wrote:
> > > Hello -
> > >
> > > I used to use netstat -P to view PCB information. Running -current, I
> > > get 'no namelist' now. Any ideas?
> > >
> > > 0xffffff0397c4da50 tcp 0 0 127.0.0.1.33845
> > > 127.0.0.1.18333 ESTABLISHED
> > >
> > > # netstat -P 0xffffff0397c4da50
> > > netstat: no namelist
> > >
> > > Thanks,
> > > David
> > >
> >
> > I am not sure if this is a fix or a hint, but it does provide me with
> > the information I used to get. Did something change that would cause
> > n_type to always be 0 (or unset?)
> >
> > Index: main.c
> > ===================================================================
> > RCS file: /cvs/src/usr.bin/netstat/main.c,v
> > retrieving revision 1.108
> > diff -u -p -r1.108 main.c
> > --- main.c 23 Oct 2015 08:18:57 -0000 1.108
> > +++ main.c 23 Nov 2015 15:50:57 -0000
> > @@ -331,7 +331,7 @@ main(int argc, char *argv[])
> > (need_nlist ? 0 : KVM_NO_FILES), buf)) == NULL)
> > errx(1, "kvm_openfiles: %s", buf);
> >
> > - if (need_nlist && (kvm_nlist(kvmd, nl) < 0 || nl[0].n_type == 0)) {
> > + if (need_nlist && (kvm_nlist(kvmd, nl) < 0)) {
> > if (nlistf)
> > errx(1, "%s: no namelist", nlistf);
> > else
> >
>
> It doesn't narrow it down very much, but this started somewhere between
> 5.8 and Oct 8th.
>
> Given that kvm_nlist(3) says "Each symbol is looked up using the n_name
> field, and if found, the corresponding n_type and n_value fields are
> filled in. These fields are set to 0 if the symbol is not found" I think
> it's a hint rather than a fix.
>
mpi broke it :) I think we no longer have a rt_tables symbol and so the
field is set to 0. Guess someone needs to sit down and write a new KVM
routing table dumper.
I guess in the -P case this check does not make sense but it may actually
make sense to verify that the passed pointer is actually a socket. That is
not going to be trivial...
--
:wq Claudio