diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2003-04-10 20:33:10 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2003-04-10 20:33:10 +0000 |
| commit | cacd79e2c9f9c3c7a98f7b9e884b0eb5b1d02f1f (patch) | |
| tree | 027d8706a8bea770ce4e8c638bda86ace427ad7e /sys/netinet/tcp_subr.c | |
| parent | cbd0150530f3f91a83f3aff3899d5dc046a58cda (diff) | |
Notes
Diffstat (limited to 'sys/netinet/tcp_subr.c')
| -rw-r--r-- | sys/netinet/tcp_subr.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index e96647fa7f62..58395f5ef82e 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -926,11 +926,21 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) for (inp = LIST_FIRST(tcbinfo.listhead), i = 0; inp && i < n; inp = LIST_NEXT(inp, inp_list)) { INP_LOCK(inp); - if (inp->inp_gencnt <= gencnt && - (((inp->inp_vflag & INP_TIMEWAIT) && - cr_cansee(req->td->td_ucred, intotw(inp)->tw_cred) == 0) || - cr_canseesocket(req->td->td_ucred, inp->inp_socket) == 0)) - inp_list[i++] = inp; + if (inp->inp_gencnt <= gencnt) { + /* + * XXX: This use of cr_cansee(), introduced with + * TCP state changes, is not quite right, but for + * now, better than nothing. + */ + if (inp->inp_vflag & INP_TIMEWAIT) + error = cr_cansee(req->td->td_ucred, + intotw(inp)->tw_cred); + else + error = cr_canseesocket(req->td->td_ucred, + inp->inp_socket); + if (error == 0) + inp_list[i++] = inp; + } INP_UNLOCK(inp); } INP_INFO_RUNLOCK(&tcbinfo); |
