Avoid unlocking the inp twice if badport_bandlim() returns -1.

Reported by:	jlemon
This commit is contained in:
Jeffrey Hsu 2002-06-24 22:25:00 +00:00
parent 09152a86ff
commit 6fd22caf91
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=98781
2 changed files with 8 additions and 4 deletions

View file

@ -2216,8 +2216,6 @@ tcp_input(m, off0)
goto drop;
/* IPv6 anycast check is done at tcp6_input() */
if (tp)
INP_UNLOCK(inp);
/*
* Perform bandwidth limiting.
*/
@ -2229,6 +2227,10 @@ tcp_input(m, off0)
tcp_trace(TA_DROP, ostate, tp, (void *)tcp_saveipgen,
&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,

View file

@ -2216,8 +2216,6 @@ tcp_input(m, off0)
goto drop;
/* IPv6 anycast check is done at tcp6_input() */
if (tp)
INP_UNLOCK(inp);
/*
* Perform bandwidth limiting.
*/
@ -2229,6 +2227,10 @@ tcp_input(m, off0)
tcp_trace(TA_DROP, ostate, tp, (void *)tcp_saveipgen,
&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,