summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2018-03-27 12:25:45 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2018-03-27 12:25:45 +0000
commit071af98c75413701db03a96ce2d39b13aadc775f (patch)
treef7827d6e14758e610c553f7ab4393e5356242510
parentd0b07e82639d8b5395b7297d94674ff3c006630c (diff)
parentf6eb544affab78a978fdf94368d923e79e7a045b (diff)
downloadillumos-joyent-071af98c75413701db03a96ce2d39b13aadc775f.tar.gz
[illumos-gate merge]
commit f6eb544affab78a978fdf94368d923e79e7a045b 9336 addr::conn_status crashes mdb
-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);
}