diff options
| author | Gleb Smirnoff <glebius@FreeBSD.org> | 2017-10-02 23:29:56 +0000 |
|---|---|---|
| committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2017-10-02 23:29:56 +0000 |
| commit | 0e229f343f4e8791f84a7acc6300f0bd1476c7b5 (patch) | |
| tree | 2811f4d846f70a25dfb21f6569e58b90a61dd304 /usr.bin | |
| parent | 9d1d1d1900e60d56d2505beb8286ed7b9dde63c1 (diff) | |
Notes
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/bluetooth/btsockstat/btsockstat.c | 1 | ||||
| -rw-r--r-- | usr.bin/netstat/inet.c | 3 | ||||
| -rw-r--r-- | usr.bin/netstat/netgraph.c | 1 | ||||
| -rw-r--r-- | usr.bin/netstat/unix.c | 24 | ||||
| -rw-r--r-- | usr.bin/sockstat/sockstat.c | 11 | ||||
| -rw-r--r-- | usr.bin/systat/netstat.c | 1 |
6 files changed, 21 insertions, 20 deletions
diff --git a/usr.bin/bluetooth/btsockstat/btsockstat.c b/usr.bin/bluetooth/btsockstat/btsockstat.c index 78f61279d47c..67d95f295b04 100644 --- a/usr.bin/bluetooth/btsockstat/btsockstat.c +++ b/usr.bin/bluetooth/btsockstat/btsockstat.c @@ -35,6 +35,7 @@ #include <sys/protosw.h> #include <sys/queue.h> #include <sys/socket.h> +#define _WANT_SOCKET #include <sys/socketvar.h> #include <net/if.h> diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index d0c56006b0e3..03c779dcad70 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include <sys/domain.h> #include <sys/protosw.h> #include <sys/socket.h> +#define _WANT_SOCKET #include <sys/socketvar.h> #include <sys/sysctl.h> @@ -172,7 +173,7 @@ sotoxsocket(struct socket *so, struct xsocket *xso) xso->xso_family = domain.dom_family; xso->so_timeo = so->so_timeo; xso->so_error = so->so_error; - if (SOLISTENING(so)) { + if ((so->so_options & SO_ACCEPTCONN) != 0) { xso->so_qlen = so->sol_qlen; xso->so_incqlen = so->sol_incqlen; xso->so_qlimit = so->sol_qlimit; diff --git a/usr.bin/netstat/netgraph.c b/usr.bin/netstat/netgraph.c index dc3ad829ef62..68ebcf7eff0a 100644 --- a/usr.bin/netstat/netgraph.c +++ b/usr.bin/netstat/netgraph.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/queue.h> #include <sys/socket.h> +#define _WANT_SOCKET #include <sys/socketvar.h> #include <sys/protosw.h> #include <sys/linker.h> diff --git a/usr.bin/netstat/unix.c b/usr.bin/netstat/unix.c index 3b83f2ca006a..34e6b3977b1f 100644 --- a/usr.bin/netstat/unix.c +++ b/usr.bin/netstat/unix.c @@ -43,10 +43,12 @@ __FBSDID("$FreeBSD$"); #include <sys/queue.h> #include <sys/protosw.h> #include <sys/socket.h> +#define _WANT_SOCKET #include <sys/socketvar.h> #include <sys/mbuf.h> #include <sys/sysctl.h> #include <sys/un.h> +#define _WANT_UNPCB #include <sys/unpcb.h> #include <netinet/in.h> @@ -100,7 +102,7 @@ static int pcblist_kvm(u_long count_off, u_long gencnt_off, u_long head_off, char **bufp) { struct unp_head head; - struct unpcb *unp, unp_conn; + struct unpcb *unp, unp0, unp_conn; u_char sun_len; struct socket so; struct xunpgen xug; @@ -150,8 +152,8 @@ pcblist_kvm(u_long count_off, u_long gencnt_off, u_long head_off, char **bufp) KREAD(head_off, &head, sizeof(head)); LIST_FOREACH(unp, &head, unp_link) { xu.xu_unpp = unp; - KREAD(unp, &xu.xu_unp, sizeof (*unp)); - unp = &xu.xu_unp; + KREAD(unp, &unp0, sizeof (*unp)); + unp = &unp0; if (unp->unp_gencnt > unp_gencnt) continue; @@ -236,7 +238,7 @@ unixpr(u_long count_off, u_long gencnt_off, u_long dhead_off, u_long shead_off, so = &xunp->xu_socket; /* Ignore PCBs which were freed during copyout. */ - if (xunp->xu_unp.unp_gencnt > oxug->xug_gen) + if (xunp->unp_gencnt > oxug->xug_gen) continue; if (*first) { xo_open_list("socket"); @@ -268,7 +270,6 @@ unixpr(u_long count_off, u_long gencnt_off, u_long dhead_off, u_long shead_off, static void unixdomainpr(struct xunpcb *xunp, struct xsocket *so) { - struct unpcb *unp; struct sockaddr_un *sa; static int first = 1; char buf1[33]; @@ -292,11 +293,7 @@ unixdomainpr(struct xunpcb *xunp, struct xsocket *so) }; int fmt = (sizeof(void *) == 8) ? 1 : 0; - unp = &xunp->xu_unp; - if (unp->unp_addr) - sa = &xunp->xu_addr; - else - sa = (struct sockaddr_un *)0; + sa = (xunp->xu_addr.sun_family == AF_UNIX) ? &xunp->xu_addr : NULL; if (first && !Lflag) { xo_emit("{T:Active UNIX domain sockets}\n"); @@ -318,10 +315,9 @@ unixdomainpr(struct xunpcb *xunp, struct xsocket *so) } else { xo_emit(format[fmt], (long)so->so_pcb, socktype[so->so_type], so->so_rcv.sb_cc, - so->so_snd.sb_cc, (long)unp->unp_vnode, - (long)unp->unp_conn, - (long)LIST_FIRST(&unp->unp_refs), - (long)LIST_NEXT(unp, unp_reflink)); + so->so_snd.sb_cc, (long)xunp->unp_vnode, + (long)xunp->unp_conn, (long)xunp->xu_firstref, + (long)xunp->xu_nextref); } if (sa) xo_emit(" {:path/%.*s}", diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index ea439dc8d1f1..02b43b81374c 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include <sys/user.h> #include <sys/un.h> +#define _WANT_UNPCB #include <sys/unpcb.h> #include <net/route.h> @@ -784,8 +785,8 @@ gather_unix(int proto) warnx("struct xunpcb size mismatch"); goto out; } - if ((xup->xu_unp.unp_conn == NULL && !opt_l) || - (xup->xu_unp.unp_conn != NULL && !opt_c)) + if ((xup->unp_conn == NULL && !opt_l) || + (xup->unp_conn != NULL && !opt_c)) continue; if ((sock = calloc(1, sizeof(*sock))) == NULL) err(1, "malloc()"); @@ -798,11 +799,11 @@ gather_unix(int proto) sock->proto = proto; sock->family = AF_UNIX; sock->protoname = protoname; - if (xup->xu_unp.unp_addr != NULL) + if (xup->xu_addr.sun_family == AF_UNIX) laddr->address = *(struct sockaddr_storage *)(void *)&xup->xu_addr; - else if (xup->xu_unp.unp_conn != NULL) - *(void **)&(faddr->address) = xup->xu_unp.unp_conn; + else if (xup->unp_conn != NULL) + *(void **)&(faddr->address) = xup->unp_conn; laddr->next = NULL; faddr->next = NULL; sock->laddr = laddr; diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c index 5ab367a0a878..704df8a9dbf1 100644 --- a/usr.bin/systat/netstat.c +++ b/usr.bin/systat/netstat.c @@ -41,6 +41,7 @@ static const char sccsid[] = "@(#)netstat.c 8.1 (Berkeley) 6/6/93"; #include <sys/param.h> #include <sys/queue.h> #include <sys/socket.h> +#define _WANT_SOCKET #include <sys/socketvar.h> #include <sys/protosw.h> |
