netstat for vnets

Marko Zec zec at fer.hr
Tue Feb 11 10:42:57 UTC 2014


On Mon, 10 Feb 2014 21:24:52 -0800
Vijay Singh <vijju.singh at gmail.com> wrote:

> How does "jexec <jid> netstat -an" get its data from the kernel? I
> know that netstat uses kvm, but I'm not sure how it works with
> vnet-jails. Any pointers would be much appreciated.

I think these days libkvm first tries to find "native" symbols via
kldsym(), and if it fails, attempts to prepend a "vnet_entry_" prefix
in front of the search key, which then get resolved to the proper
addres in _kvm_vnet_validaddr() in lib/libkvm/kvm_vnet.c.  In the early
days of VIMAGE it was the kernel who was responsible for resolving the
symbol address in the proper vnet, honestly I do not recall when the
magic moved to the userland and why...

Btw. Vijay - did the patch I posted here:
http://lists.freebsd.org/pipermail/freebsd-net/2014-February/037769.html
resolve the panics you complained about?

Cheers,

Marko


More information about the freebsd-net mailing list