diff options
author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2009-03-20 21:22:14 +0000 |
---|---|---|
committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2009-03-20 21:22:14 +0000 |
commit | cefb7d321197f3faf2beeabecc33711cae7a219c (patch) | |
tree | 0a4edce18bf3d805222a7d1087019fe19f262062 | |
parent | 2732494684c4c6f02488d76a4d6683f5474b2ab1 (diff) |
Notes
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 42 | ||||
-rw-r--r-- | sys/netinet6/in6_pcb.c | 10 | ||||
-rw-r--r-- | sys/netinet6/in6_pcb.h | 1 | ||||
-rw-r--r-- | sys/netinet6/raw_ip6.c | 2 | ||||
-rw-r--r-- | sys/netinet6/udp6_usrreq.c | 2 |
5 files changed, 12 insertions, 45 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 156631bef3907..eaaac0ec85740 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -183,24 +183,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 { @@ -216,23 +207,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); } } @@ -1481,17 +1463,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(&tcbinfo); return (ENOBUFS); } diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index e77ad996a88bf..1e079cdc83a1a 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -413,16 +413,6 @@ in6_pcbdisconnect(struct inpcb *inp) } void -in6_pcbdetach(struct inpcb *inp) -{ - - KASSERT(inp->inp_socket != NULL, ("%s: inp_socket == NULL", __func__)); - - inp->inp_socket->so_pcb = NULL; - inp->inp_socket = NULL; -} - -void in6_pcbfree(struct inpcb *inp) { struct inpcbinfo *ipi = inp->inp_pcbinfo; diff --git a/sys/netinet6/in6_pcb.h b/sys/netinet6/in6_pcb.h index c1e2107bd815a..c76f9f1bad231 100644 --- a/sys/netinet6/in6_pcb.h +++ b/sys/netinet6/in6_pcb.h @@ -73,7 +73,6 @@ void in6_pcbpurgeif0 __P((struct inpcbinfo *, struct ifnet *)); void in6_losing __P((struct inpcb *)); int in6_pcbbind __P((struct inpcb *, struct sockaddr *, struct ucred *)); int in6_pcbconnect __P((struct inpcb *, struct sockaddr *, struct ucred *)); -void in6_pcbdetach __P((struct inpcb *)); void in6_pcbdisconnect __P((struct inpcb *)); void in6_pcbfree __P((struct inpcb *)); int in6_pcbladdr __P((struct inpcb *, struct sockaddr *, diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 5f7b2cd2053d8..279e19317ef7d 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -600,7 +600,7 @@ rip6_detach(struct socket *so) INP_INFO_WLOCK(&ripcbinfo); INP_WLOCK(inp); FREE(inp->in6p_icmp6filt, M_PCB); - in6_pcbdetach(inp); + in_pcbdetach(inp); in6_pcbfree(inp); INP_INFO_WUNLOCK(&ripcbinfo); } diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 86b6253d10386..4e878eb29f42a 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -889,7 +889,7 @@ udp6_detach(struct socket *so) INP_INFO_WLOCK(&udbinfo); INP_WLOCK(inp); - in6_pcbdetach(inp); + in_pcbdetach(inp); in6_pcbfree(inp); INP_INFO_WUNLOCK(&udbinfo); } |