diff options
author | hsu <hsu@FreeBSD.org> | 2002-06-24 22:25:00 +0000 |
---|---|---|
committer | hsu <hsu@FreeBSD.org> | 2002-06-24 22:25:00 +0000 |
commit | deb4c976c70a41d55dcee24ba313a543e54dfc5c (patch) | |
tree | 011fc79a4096b24dcd1adaed58dfbd2fc9cdcec1 /sys | |
parent | a564153d5c8253884ca2dc7d3dd45b46ca8badc6 (diff) | |
download | FreeBSD-src-deb4c976c70a41d55dcee24ba313a543e54dfc5c.zip FreeBSD-src-deb4c976c70a41d55dcee24ba313a543e54dfc5c.tar.gz |
Avoid unlocking the inp twice if badport_bandlim() returns -1.
Reported by: jlemon
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/tcp_input.c | 6 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 6a2b69d..0fb62e0 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2216,8 +2216,6 @@ dropwithreset: goto drop; /* IPv6 anycast check is done at tcp6_input() */ - if (tp) - INP_UNLOCK(inp); /* * Perform bandwidth limiting. */ @@ -2229,6 +2227,10 @@ dropwithreset: 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, diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 6a2b69d..0fb62e0 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -2216,8 +2216,6 @@ dropwithreset: goto drop; /* IPv6 anycast check is done at tcp6_input() */ - if (tp) - INP_UNLOCK(inp); /* * Perform bandwidth limiting. */ @@ -2229,6 +2227,10 @@ dropwithreset: 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, |