summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2008-11-27 12:04:35 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2008-11-27 12:04:35 +0000
commit6aee2fc550d27a19446cf586f4aec7f7eb6743b2 (patch)
treee1f15662baedc4c9181ee6f9e4cd9ced42b3fbba /sys/netinet/tcp_usrreq.c
parentcb5c4b10ba7c6d9f83b961c24be8f766ea6156c0 (diff)
Notes
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 3127c863c82b..9661a977b9ab 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -156,9 +156,6 @@ static void
tcp_detach(struct socket *so, struct inpcb *inp)
{
struct tcpcb *tp;
-#ifdef INET6
- int isipv6 = INP_CHECK_SOCKAF(so, AF_INET6) != 0;
-#endif
#ifdef INVARIANTS
INIT_VNET_INET(so->so_vnet);
#endif
@@ -188,12 +185,7 @@ tcp_detach(struct socket *so, struct inpcb *inp)
KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && "
"INP_DROPPED && tp != NULL"));
in_pcbdetach(inp);
-#ifdef INET6
- if (isipv6)
- in6_pcbfree(inp);
- else
-#endif
- in_pcbfree(inp);
+ in_pcbfree(inp);
} else {
in_pcbdetach(inp);
INP_WUNLOCK(inp);
@@ -212,15 +204,9 @@ tcp_detach(struct socket *so, struct inpcb *inp)
tp->t_state < TCPS_SYN_SENT) {
tcp_discardcb(tp);
in_pcbdetach(inp);
-#ifdef INET6
- if (isipv6)
- in6_pcbfree(inp);
- else
-#endif
- in_pcbfree(inp);
- } else {
- in_pcbdetach(inp);
- }
+ in_pcbfree(inp);
+ } else
+ in_pcbdetach(inp);
}
}
@@ -1479,12 +1465,7 @@ tcp_attach(struct socket *so)
tp = tcp_newtcpcb(inp);
if (tp == NULL) {
in_pcbdetach(inp);
-#ifdef INET6
- if (isipv6)
- in6_pcbfree(inp);
- else
-#endif
- in_pcbfree(inp);
+ in_pcbfree(inp);
INP_INFO_WUNLOCK(&V_tcbinfo);
return (ENOBUFS);
}