aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/netstat/inet.c4
-rw-r--r--usr.bin/netstat/unix.c2
-rw-r--r--usr.bin/sockstat/sockstat.c22
3 files changed, 14 insertions, 14 deletions
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index ad347f5c416e..5d379dcfa577 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -159,12 +159,12 @@ sotoxsocket(struct socket *so, struct xsocket *xso)
bzero(xso, sizeof *xso);
xso->xso_len = sizeof *xso;
- xso->xso_so = so;
+ xso->xso_so = (kvaddr_t)so;
xso->so_type = so->so_type;
xso->so_options = so->so_options;
xso->so_linger = so->so_linger;
xso->so_state = so->so_state;
- xso->so_pcb = so->so_pcb;
+ xso->so_pcb = (kvaddr_t)so->so_pcb;
if (kread((uintptr_t)so->so_proto, &proto, sizeof(proto)) != 0)
return (-1);
xso->xso_protocol = proto.pr_protocol;
diff --git a/usr.bin/netstat/unix.c b/usr.bin/netstat/unix.c
index be2a145c3b4f..e0eeca0d9c6a 100644
--- a/usr.bin/netstat/unix.c
+++ b/usr.bin/netstat/unix.c
@@ -153,7 +153,7 @@ pcblist_kvm(u_long count_off, u_long gencnt_off, u_long head_off, char **bufp)
xu.xu_len = sizeof xu;
KREAD(head_off, &head, sizeof(head));
LIST_FOREACH(unp, &head, unp_link) {
- xu.xu_unpp = unp;
+ xu.xu_unpp = (kvaddr_t)unp;
KREAD(unp, &unp0, sizeof (*unp));
unp = &unp0;
diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c
index 01c75d8039ea..6c446e120e3d 100644
--- a/usr.bin/sockstat/sockstat.c
+++ b/usr.bin/sockstat/sockstat.c
@@ -108,8 +108,8 @@ struct addr {
};
struct sock {
- void *socket;
- void *pcb;
+ kvaddr_t socket;
+ kvaddr_t pcb;
int shown;
int vflag;
int family;
@@ -789,8 +789,8 @@ gather_unix(int proto)
warnx("struct xunpcb size mismatch");
goto out;
}
- if ((xup->unp_conn == NULL && !opt_l) ||
- (xup->unp_conn != NULL && !opt_c))
+ if ((xup->unp_conn == 0 && !opt_l) ||
+ (xup->unp_conn != 0 && !opt_c))
continue;
if ((sock = calloc(1, sizeof(*sock))) == NULL)
err(1, "malloc()");
@@ -806,8 +806,8 @@ gather_unix(int proto)
if (xup->xu_addr.sun_family == AF_UNIX)
laddr->address =
*(struct sockaddr_storage *)(void *)&xup->xu_addr;
- else if (xup->unp_conn != NULL)
- *(void **)&(faddr->address) = xup->unp_conn;
+ else if (xup->unp_conn != 0)
+ *(kvaddr_t*)&(faddr->address) = xup->unp_conn;
laddr->next = NULL;
faddr->next = NULL;
sock->laddr = laddr;
@@ -1008,7 +1008,7 @@ sctp_path_state(int state)
static void
displaysock(struct sock *s, int pos)
{
- void *p;
+ kvaddr_t p;
int hash, first, offset;
struct addr *laddr, *faddr;
struct sock *s_tmp;
@@ -1054,8 +1054,8 @@ displaysock(struct sock *s, int pos)
break;
}
/* client */
- p = *(void **)&(faddr->address);
- if (p == NULL) {
+ p = *(kvaddr_t*)&(faddr->address);
+ if (p == 0) {
pos += xprintf("(not connected)");
offset += opt_w ? 92 : 44;
break;
@@ -1174,13 +1174,13 @@ display(void)
}
setpassent(1);
for (xf = xfiles, n = 0; n < nxfiles; ++n, ++xf) {
- if (xf->xf_data == NULL)
+ if (xf->xf_data == 0)
continue;
if (opt_j >= 0 && opt_j != getprocjid(xf->xf_pid))
continue;
hash = (int)((uintptr_t)xf->xf_data % HASHSIZE);
for (s = sockhash[hash]; s != NULL; s = s->next) {
- if ((void *)s->socket != xf->xf_data)
+ if (s->socket != xf->xf_data)
continue;
if (!check_ports(s))
continue;