diff options
author | sam <sam@FreeBSD.org> | 2003-11-08 22:59:22 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2003-11-08 22:59:22 +0000 |
commit | a946bc48542e72d387e36143fc640b4c10c4abd0 (patch) | |
tree | bd94a2c78786d58254f94cedcab8ba90eab44e4d /sys/netinet/tcp_input.c | |
parent | b84b4aa531ee10b022780d62bdc166be0f3551d6 (diff) | |
download | FreeBSD-src-a946bc48542e72d387e36143fc640b4c10c4abd0.zip FreeBSD-src-a946bc48542e72d387e36143fc640b4c10c4abd0.tar.gz |
o correct locking problem: the inpcb must be held across tcp_respond
o add assertions in tcp_respond to validate inpcb locking assumptions
o use local variable instead of chasing pointers in tcp_respond
Supported by: FreeBSD Foundation
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 21d530f..97f7f3c 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2348,9 +2348,6 @@ dropwithreset: &tcp_savetcp, 0); #endif - if (tp) - INP_UNLOCK(inp); - if (thflags & TH_ACK) /* mtod() below is safe as long as hdr dropping is delayed */ tcp_respond(tp, mtod(m, void *), th, m, (tcp_seq)0, th->th_ack, @@ -2362,6 +2359,9 @@ dropwithreset: tcp_respond(tp, mtod(m, void *), th, m, th->th_seq+tlen, (tcp_seq)0, TH_RST|TH_ACK); } + + if (tp) + INP_UNLOCK(inp); if (headlocked) INP_INFO_WUNLOCK(&tcbinfo); return; |