diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-08-07 12:12:37 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-09-21 10:29:36 +0200 |
commit | de261e0404e1fe54544275fc57d5b982df4f42b4 (patch) | |
tree | 856cbdf23d6809b99c4d642d066bc45cd67c26e6 /freebsd/sys/kern/sys_socket.c | |
parent | libbsd.txt: Use rtems_bsd_ifconfig_lo0() (diff) | |
download | rtems-libbsd-de261e0404e1fe54544275fc57d5b982df4f42b4.tar.bz2 |
Update to FreeBSD head 2017-06-01
Git mirror commit dfb26efac4ce9101dda240e94d9ab53f80a9e131.
Update #3472.
Diffstat (limited to 'freebsd/sys/kern/sys_socket.c')
-rw-r--r-- | freebsd/sys/kern/sys_socket.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/freebsd/sys/kern/sys_socket.c b/freebsd/sys/kern/sys_socket.c index 3ffb1839..8d87c51b 100644 --- a/freebsd/sys/kern/sys_socket.c +++ b/freebsd/sys/kern/sys_socket.c @@ -576,18 +576,23 @@ soo_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) kif->kf_type = KF_TYPE_SOCKET; so = fp->f_data; - kif->kf_sock_domain = so->so_proto->pr_domain->dom_family; - kif->kf_sock_type = so->so_type; - kif->kf_sock_protocol = so->so_proto->pr_protocol; + kif->kf_un.kf_sock.kf_sock_domain0 = + so->so_proto->pr_domain->dom_family; + kif->kf_un.kf_sock.kf_sock_type0 = so->so_type; + kif->kf_un.kf_sock.kf_sock_protocol0 = so->so_proto->pr_protocol; kif->kf_un.kf_sock.kf_sock_pcb = (uintptr_t)so->so_pcb; - switch (kif->kf_sock_domain) { + switch (kif->kf_un.kf_sock.kf_sock_domain0) { case AF_INET: case AF_INET6: - if (kif->kf_sock_protocol == IPPROTO_TCP) { + if (kif->kf_un.kf_sock.kf_sock_protocol0 == IPPROTO_TCP) { if (so->so_pcb != NULL) { inpcb = (struct inpcb *)(so->so_pcb); kif->kf_un.kf_sock.kf_sock_inpcb = (uintptr_t)inpcb->inp_ppcb; + kif->kf_un.kf_sock.kf_sock_sendq = + sbused(&so->so_snd); + kif->kf_un.kf_sock.kf_sock_recvq = + sbused(&so->so_rcv); } } break; @@ -601,18 +606,24 @@ soo_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) so->so_rcv.sb_state; kif->kf_un.kf_sock.kf_sock_snd_sb_state = so->so_snd.sb_state; + kif->kf_un.kf_sock.kf_sock_sendq = + sbused(&so->so_snd); + kif->kf_un.kf_sock.kf_sock_recvq = + sbused(&so->so_rcv); } } break; } error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); - if (error == 0 && sa->sa_len <= sizeof(kif->kf_sa_local)) { - bcopy(sa, &kif->kf_sa_local, sa->sa_len); + if (error == 0 && + sa->sa_len <= sizeof(kif->kf_un.kf_sock.kf_sa_local)) { + bcopy(sa, &kif->kf_un.kf_sock.kf_sa_local, sa->sa_len); free(sa, M_SONAME); } error = so->so_proto->pr_usrreqs->pru_peeraddr(so, &sa); - if (error == 0 && sa->sa_len <= sizeof(kif->kf_sa_peer)) { - bcopy(sa, &kif->kf_sa_peer, sa->sa_len); + if (error == 0 && + sa->sa_len <= sizeof(kif->kf_un.kf_sock.kf_sa_peer)) { + bcopy(sa, &kif->kf_un.kf_sock.kf_sa_peer, sa->sa_len); free(sa, M_SONAME); } strncpy(kif->kf_path, so->so_proto->pr_domain->dom_name, |