Deleted Added
full compact
in_pcb.c (86487) in_pcb.c (86764)
1/*
2 * Copyright (c) 1982, 1986, 1991, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)in_pcb.c 8.4 (Berkeley) 5/24/95
1/*
2 * Copyright (c) 1982, 1986, 1991, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)in_pcb.c 8.4 (Berkeley) 5/24/95
34 * $FreeBSD: head/sys/netinet/in_pcb.c 86487 2001-11-17 03:07:11Z dillon $
34 * $FreeBSD: head/sys/netinet/in_pcb.c 86764 2001-11-22 04:50:44Z jlemon $
35 */
36
37#include "opt_ipsec.h"
38#include "opt_inet6.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/malloc.h>

--- 507 unchanged lines hidden (view full) ---

550}
551
552void
553in_pcbdetach(inp)
554 struct inpcb *inp;
555{
556 struct socket *so = inp->inp_socket;
557 struct inpcbinfo *ipi = inp->inp_pcbinfo;
35 */
36
37#include "opt_ipsec.h"
38#include "opt_inet6.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/malloc.h>

--- 507 unchanged lines hidden (view full) ---

550}
551
552void
553in_pcbdetach(inp)
554 struct inpcb *inp;
555{
556 struct socket *so = inp->inp_socket;
557 struct inpcbinfo *ipi = inp->inp_pcbinfo;
558 struct rtentry *rt = inp->inp_route.ro_rt;
559
560#ifdef IPSEC
561 ipsec4_delete_pcbpolicy(inp);
562#endif /*IPSEC*/
563 inp->inp_gencnt = ++ipi->ipi_gencnt;
564 in_pcbremlists(inp);
565 so->so_pcb = 0;
566 sotryfree(so);
567 if (inp->inp_options)
568 (void)m_free(inp->inp_options);
558
559#ifdef IPSEC
560 ipsec4_delete_pcbpolicy(inp);
561#endif /*IPSEC*/
562 inp->inp_gencnt = ++ipi->ipi_gencnt;
563 in_pcbremlists(inp);
564 so->so_pcb = 0;
565 sotryfree(so);
566 if (inp->inp_options)
567 (void)m_free(inp->inp_options);
569 if (rt) {
570 /*
571 * route deletion requires reference count to be <= zero
572 */
573 if ((rt->rt_flags & RTF_DELCLONE) &&
574 (rt->rt_flags & RTF_WASCLONED) &&
575 (rt->rt_refcnt <= 1)) {
576 rt->rt_refcnt--;
577 rt->rt_flags &= ~RTF_UP;
578 rtrequest(RTM_DELETE, rt_key(rt),
579 rt->rt_gateway, rt_mask(rt),
580 rt->rt_flags, (struct rtentry **)0);
581 }
582 else
583 rtfree(rt);
584 }
568 if (inp->inp_route.ro_rt)
569 rtfree(inp->inp_route.ro_rt);
585 ip_freemoptions(inp->inp_moptions);
586 inp->inp_vflag = 0;
587 zfree(ipi->ipi_zone, inp);
588}
589
590/*
591 * The calling convention of in_setsockaddr() and in_setpeeraddr() was
592 * modified to match the pru_sockaddr() and pru_peeraddr() entry points

--- 461 unchanged lines hidden ---
570 ip_freemoptions(inp->inp_moptions);
571 inp->inp_vflag = 0;
572 zfree(ipi->ipi_zone, inp);
573}
574
575/*
576 * The calling convention of in_setsockaddr() and in_setpeeraddr() was
577 * modified to match the pru_sockaddr() and pru_peeraddr() entry points

--- 461 unchanged lines hidden ---