James Carlson wrote:
Peter Memishian writes:
> I removed icmp_status from ndd and added it to mdb. The new webrev is
> here: http://cr.opensolaris.org/~vassun08/mdbmacro-webrev-r4/
>
>
> Files changed:
>
> usr/src/cmd/mdb/common/modules/genunix/genunix.c*
> *usr/src/cmd/mdb/common/modules/genunix/net.c
> usr/src/uts/common/inet/ip/icmp.c
> usr/src/uts/common/inet/ip/ip.c
> usr/src/uts/common/inet/mi.h
Looks good. A few comments on your changes to genunix/net.c (some of
these may apply more broadly to this file):
* Why does netstat_icmp_cb() allocate the conn_t via
mdb_alloc() rather than just allocating it on the stack?
(It's less than 500 bytes).
One has to be pretty careful with stack space. kmdb has a tendency to
explode when faced with "big" stack variables -- where "big" isn't
very large at all.
I agree with allocating it, but allocating it as part of the caller is
better.
(Besides, I thought the walker already allocated the structure being
walked and passed in a pointer to a read-in copy of it, meaning that
no mdb_vread on 'kaddr' was necessary ...)
No, the walker does not pass a read-in copy of the structure. mdb_vread
has to be done on the address passed to get the data.
I will mdb_allocate conn_t in the caller (which is netstat())as part of
the walk callback data passed to mdb_pwalk on the *_conn_caches instead
of doing it inside the callback itself.
_______________________________________________
networking-discuss mailing list
[email protected]