Deleted Added
full compact
rtsock.c (11459) rtsock.c (11819)
1/*
2 * Copyright (c) 1988, 1991, 1993
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 * @(#)rtsock.c 8.5 (Berkeley) 11/2/94
1/*
2 * Copyright (c) 1988, 1991, 1993
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 * @(#)rtsock.c 8.5 (Berkeley) 11/2/94
34 * $Id: rtsock.c,v 1.14 1995/10/09 04:06:28 bde Exp $
34 * $Id: rtsock.c,v 1.15 1995/10/13 16:01:59 wollman Exp $
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/kernel.h>
40#include <sys/proc.h>
41#include <sys/mbuf.h>
42#include <sys/socket.h>

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

87 register struct rawcb *rp = sotorawcb(so);
88 int s;
89
90 if (req == PRU_ATTACH) {
91 MALLOC(rp, struct rawcb *, sizeof(*rp), M_PCB, M_WAITOK);
92 so->so_pcb = (caddr_t)rp;
93 if (so->so_pcb)
94 bzero(so->so_pcb, sizeof(*rp));
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/kernel.h>
40#include <sys/proc.h>
41#include <sys/mbuf.h>
42#include <sys/socket.h>

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

87 register struct rawcb *rp = sotorawcb(so);
88 int s;
89
90 if (req == PRU_ATTACH) {
91 MALLOC(rp, struct rawcb *, sizeof(*rp), M_PCB, M_WAITOK);
92 so->so_pcb = (caddr_t)rp;
93 if (so->so_pcb)
94 bzero(so->so_pcb, sizeof(*rp));
95
96 }
97 if (req == PRU_DETACH && rp) {
98 int af = rp->rcb_proto.sp_protocol;
99 if (af == AF_INET)
100 route_cb.ip_count--;
95 }
96 if (req == PRU_DETACH && rp) {
97 int af = rp->rcb_proto.sp_protocol;
98 if (af == AF_INET)
99 route_cb.ip_count--;
100 else if (af == AF_IPX)
101 route_cb.ipx_count--;
101 else if (af == AF_NS)
102 route_cb.ns_count--;
103 else if (af == AF_ISO)
104 route_cb.iso_count--;
105 route_cb.any_count--;
106 }
107 s = splnet();
108 error = raw_usrreq(so, req, m, nam, control);
109 rp = sotorawcb(so);
110 if (req == PRU_ATTACH && rp) {
111 int af = rp->rcb_proto.sp_protocol;
112 if (error) {
113 free((caddr_t)rp, M_PCB);
114 splx(s);
115 return (error);
116 }
117 if (af == AF_INET)
118 route_cb.ip_count++;
102 else if (af == AF_NS)
103 route_cb.ns_count--;
104 else if (af == AF_ISO)
105 route_cb.iso_count--;
106 route_cb.any_count--;
107 }
108 s = splnet();
109 error = raw_usrreq(so, req, m, nam, control);
110 rp = sotorawcb(so);
111 if (req == PRU_ATTACH && rp) {
112 int af = rp->rcb_proto.sp_protocol;
113 if (error) {
114 free((caddr_t)rp, M_PCB);
115 splx(s);
116 return (error);
117 }
118 if (af == AF_INET)
119 route_cb.ip_count++;
120 else if (af == AF_IPX)
121 route_cb.ipx_count++;
119 else if (af == AF_NS)
120 route_cb.ns_count++;
121 else if (af == AF_ISO)
122 route_cb.iso_count++;
123 rp->rcb_faddr = &route_src;
124 route_cb.any_count++;
125 soisconnected(so);
126 so->so_options |= SO_USELOOPBACK;

--- 677 unchanged lines hidden ---
122 else if (af == AF_NS)
123 route_cb.ns_count++;
124 else if (af == AF_ISO)
125 route_cb.iso_count++;
126 rp->rcb_faddr = &route_src;
127 route_cb.any_count++;
128 soisconnected(so);
129 so->so_options |= SO_USELOOPBACK;

--- 677 unchanged lines hidden ---