summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2008-11-26 20:52:26 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2008-11-26 20:52:26 +0000
commit0206cdb8461ff06a42eafe71aa9163523ca3940e (patch)
treea118151fdb94beb969e478947db8088a52d8e2e5 /sys/netinet/tcp_usrreq.c
parent0eec8b9141e851ca08248dd3f28263b75631e56a (diff)
Notes
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c42
1 files changed, 10 insertions, 32 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 856d3f05b323..3127c863c82b 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -187,24 +187,15 @@ tcp_detach(struct socket *so, struct inpcb *inp)
if (inp->inp_vflag & INP_DROPPED) {
KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && "
"INP_DROPPED && tp != NULL"));
+ in_pcbdetach(inp);
#ifdef INET6
- if (isipv6) {
- in6_pcbdetach(inp);
+ if (isipv6)
in6_pcbfree(inp);
- } else {
+ else
#endif
- in_pcbdetach(inp);
in_pcbfree(inp);
-#ifdef INET6
- }
-#endif
} else {
-#ifdef INET6
- if (isipv6)
- in6_pcbdetach(inp);
- else
-#endif
- in_pcbdetach(inp);
+ in_pcbdetach(inp);
INP_WUNLOCK(inp);
}
} else {
@@ -220,23 +211,14 @@ tcp_detach(struct socket *so, struct inpcb *inp)
if (inp->inp_vflag & INP_DROPPED ||
tp->t_state < TCPS_SYN_SENT) {
tcp_discardcb(tp);
+ in_pcbdetach(inp);
#ifdef INET6
- if (isipv6) {
- in6_pcbdetach(inp);
+ if (isipv6)
in6_pcbfree(inp);
- } else {
+ else
#endif
- in_pcbdetach(inp);
in_pcbfree(inp);
-#ifdef INET6
- }
-#endif
} else {
-#ifdef INET6
- if (isipv6)
- in6_pcbdetach(inp);
- else
-#endif
in_pcbdetach(inp);
}
}
@@ -1496,17 +1478,13 @@ tcp_attach(struct socket *so)
inp->inp_vflag |= INP_IPV4;
tp = tcp_newtcpcb(inp);
if (tp == NULL) {
+ in_pcbdetach(inp);
#ifdef INET6
- if (isipv6) {
- in6_pcbdetach(inp);
+ if (isipv6)
in6_pcbfree(inp);
- } else {
+ else
#endif
- in_pcbdetach(inp);
in_pcbfree(inp);
-#ifdef INET6
- }
-#endif
INP_INFO_WUNLOCK(&V_tcbinfo);
return (ENOBUFS);
}