diff options
author | Dan McDonald <danmcd@omniti.com> | 2017-02-21 10:45:43 -0500 |
---|---|---|
committer | Dan McDonald <danmcd@omniti.com> | 2017-02-22 09:38:30 -0500 |
commit | e40108ff341f07fe03e96c751c6cf2cb5867d1a8 (patch) | |
tree | b7a3b66a9ab19822e4b44f52a1e19afe27b92544 | |
parent | 148434206d3ba623dff65e4b591dffc0ddadebf3 (diff) | |
download | illumos-joyent-e40108ff341f07fe03e96c751c6cf2cb5867d1a8.tar.gz |
7898 mdb's ::netstat doesn't print UDP conn_t pointer correctly
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Robert Mustacchi <rm@joyent.com>
-rw-r--r-- | usr/src/cmd/mdb/common/modules/genunix/net.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr/src/cmd/mdb/common/modules/genunix/net.c b/usr/src/cmd/mdb/common/modules/genunix/net.c index 3f5f54059b..6cae10c858 100644 --- a/usr/src/cmd/mdb/common/modules/genunix/net.c +++ b/usr/src/cmd/mdb/common/modules/genunix/net.c @@ -643,19 +643,20 @@ netstat_udp_cb(uintptr_t kaddr, const void *walk_data, void *cb_data) udp_t udp; conn_t *connp = &ncb->conn; char *state; + uintptr_t udp_kaddr; if (mdb_vread(connp, sizeof (conn_t), kaddr) == -1) { mdb_warn("failed to read conn_t at %p", kaddr); return (WALK_ERR); } - if (mdb_vread(&udp, sizeof (udp_t), - (uintptr_t)connp->conn_udp) == -1) { - mdb_warn("failed to read conn_udp at %p", - (uintptr_t)connp->conn_udp); + udp_kaddr = (uintptr_t)connp->conn_udp; + if (mdb_vread(&udp, sizeof (udp_t), udp_kaddr) == -1) { + mdb_warn("failed to read conn_udp at %p", udp_kaddr); return (WALK_ERR); } + /* Need to do these reassignments for the net_udp_*() routines below. */ connp->conn_udp = &udp; udp.udp_connp = connp; @@ -674,7 +675,7 @@ netstat_udp_cb(uintptr_t kaddr, const void *walk_data, void *cb_data) else state = "UNKNOWN"; - mdb_printf("%0?p %10s ", (uintptr_t)connp->conn_udp, state); + mdb_printf("%0?p %10s ", udp_kaddr, state); if (af == AF_INET) { net_ipv4addrport_pr(&connp->conn_laddr_v6, connp->conn_lport); mdb_printf(" "); |