summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2008-11-27 12:04:35 +0000
committerbz <bz@FreeBSD.org>2008-11-27 12:04:35 +0000
commit864141180ec3ef4d8192d52ae360994300a14548 (patch)
treee1f15662baedc4c9181ee6f9e4cd9ced42b3fbba /sys/netinet/tcp_usrreq.c
parentb683fcf69217f7195e73b2f05d608c952101f47a (diff)
downloadFreeBSD-src-864141180ec3ef4d8192d52ae360994300a14548.zip
FreeBSD-src-864141180ec3ef4d8192d52ae360994300a14548.tar.gz
Merge in6_pcbfree() into in_pcbfree() which after the previous
IPsec change in r185366 only differed in two additonal IPv6 lines. Rather than splattering conditional code everywhere add the v6 check centrally at this single place. Reviewed by: rwatson (as part of a larger changset) MFC after: 6 weeks (*) (*) possibly need to leave a stub wrapper in 7 to keep the symbol.
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 3127c86..9661a97 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);
}
OpenPOWER on IntegriCloud