summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Fiddaman <omnios@citrus-it.co.uk>2018-03-23 10:31:07 +0000
committerRichard Lowe <richlowe@richlowe.net>2018-03-26 20:55:02 +0000
commitf6eb544affab78a978fdf94368d923e79e7a045b (patch)
tree4c80f8d554fa299beba4d67f20b51cb19161d5bb
parent3718f283515535a82b83e368bda0af10d2bf2c4f (diff)
downloadillumos-joyent-f6eb544affab78a978fdf94368d923e79e7a045b.tar.gz
9336 addr::conn_status crashes mdb
Reviewed by: Yuri Pankov <yuripv@yuripv.net> Reviewed by: Dominik Hassler <hadfl@omniosce.org> Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r--usr/src/cmd/mdb/common/modules/ip/ip.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr/src/cmd/mdb/common/modules/ip/ip.c b/usr/src/cmd/mdb/common/modules/ip/ip.c
index ddb6966985..d620bc6a94 100644
--- a/usr/src/cmd/mdb/common/modules/ip/ip.c
+++ b/usr/src/cmd/mdb/common/modules/ip/ip.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
*/
#include <sys/types.h>
@@ -3049,9 +3050,11 @@ conn_status_cb(uintptr_t addr, const void *walk_data,
char src_addrstr[INET6_ADDRSTRLEN];
char rem_addrstr[INET6_ADDRSTRLEN];
const ipcl_hash_walk_data_t *iw = walk_data;
- conn_t *conn = iw->conn;
+ conn_t c, *conn = &c;
- if (mdb_vread(conn, sizeof (conn_t), addr) == -1) {
+ if (iw != NULL)
+ conn = iw->conn;
+ else if (mdb_vread(conn, sizeof (conn_t), addr) == -1) {
mdb_warn("failed to read conn_t at %p", addr);
return (WALK_ERR);
}