summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_timewait.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-04-25 11:17:35 +0000
committerrwatson <rwatson@FreeBSD.org>2006-04-25 11:17:35 +0000
commit5d598011b534415b6bfa0b82fe291c836516bbd0 (patch)
treeac3c32c6d4a4115de24383a3ecb36ad35f4fff67 /sys/netinet/tcp_timewait.c
parent38b8fecaba7630458a55dc2790b6057e3ee53b53 (diff)
downloadFreeBSD-src-5d598011b534415b6bfa0b82fe291c836516bbd0.zip
FreeBSD-src-5d598011b534415b6bfa0b82fe291c836516bbd0.tar.gz
Abstract inpcb drop logic, previously just setting of INP_DROPPED in TCP,
into in_pcbdrop(). Expand logic to detach the inpcb from its bound address/port so that dropping a TCP connection releases the inpcb resource reservation, which since the introduction of socket/pcb reference count updates, has been persisting until the socket closed rather than being released implicitly due to prior freeing of the inpcb on TCP drop. MFC after: 3 months
Diffstat (limited to 'sys/netinet/tcp_timewait.c')
-rw-r--r--sys/netinet/tcp_timewait.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index d768fb3..89bd41c 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -791,8 +791,7 @@ tcp_close(struct tcpcb *tp)
INP_INFO_WLOCK_ASSERT(&tcbinfo);
INP_LOCK_ASSERT(inp);
- inp->inp_vflag |= INP_DROPPED;
-
+ in_pcbdrop(inp);
tcpstat.tcps_closed++;
KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL"));
so = inp->inp_socket;
@@ -1852,7 +1851,7 @@ tcp_twclose(struct tcptw *tw, int reuse)
tw->tw_inpcb = NULL;
tcp_timer_2msl_stop(tw);
inp->inp_ppcb = NULL;
- inp->inp_vflag |= INP_DROPPED;
+ in_pcbdrop(inp);
so = inp->inp_socket;
if (so != NULL) {
OpenPOWER on IntegriCloud