aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2010-06-03 09:15:52 +0000
committerRobert Watson <rwatson@FreeBSD.org>2010-06-03 09:15:52 +0000
commitef9bfed8fbe32d9e5588e26f252ef87d8af7fb94 (patch)
treedfa94fd9b4c977d52f49065f9fc1d1e29acc342e /sys
parente5dbe8eca067a55cbb641a0f23ced92656874a8f (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/fs/nfsserver/nfs_nfsdport.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index d5607f9cedcc..ba367e300697 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -2674,24 +2674,23 @@ nfsrv_getsocksndseq(struct socket *so, tcp_seq *maxp, tcp_seq *unap)
{
struct inpcb *inp;
struct tcpcb *tp;
- int error = EPIPE;
- INP_INFO_RLOCK(&V_tcbinfo);
inp = sotoinpcb(so);
- if (inp == NULL) {
- INP_INFO_RUNLOCK(&V_tcbinfo);
- return (error);
- }
+ KASSERT(inp != NULL, ("nfsrv_getsocksndseq: inp == NULL"));
INP_RLOCK(inp);
- INP_INFO_RUNLOCK(&V_tcbinfo);
+ if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
+ INP_RUNLOCK(inp);
+ return (EPIPE);
+ }
tp = intotcpcb(inp);
- if (tp != NULL && tp->t_state == TCPS_ESTABLISHED) {
- *maxp = tp->snd_max;
- *unap = tp->snd_una;
- error = 0;
+ if (tp->t_state != TCPS_ESTABLISHED) {
+ INP_RUNLOCK(inp);
+ return (EPIPE);
}
+ *maxp = tp->snd_max;
+ *unap = tp->snd_una;
INP_RUNLOCK(inp);
- return (error);
+ return (0);
}
/*