Deleted Added
full compact
sctp_peeloff.c (171943) sctp_peeloff.c (171990)
1/*-
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.

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

27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31
32/* $KAME: sctp_peeloff.c,v 1.13 2005/03/06 16:04:18 itojun Exp $ */
33
34#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.

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

27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31
32/* $KAME: sctp_peeloff.c,v 1.13 2005/03/06 16:04:18 itojun Exp $ */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/netinet/sctp_peeloff.c 171943 2007-08-24 00:53:53Z rrs $");
35__FBSDID("$FreeBSD: head/sys/netinet/sctp_peeloff.c 171990 2007-08-27 05:19:48Z rrs $");
36#include <netinet/sctp_os.h>
37#include <netinet/sctp_pcb.h>
38#include <netinet/sctputil.h>
39#include <netinet/sctp_var.h>
40#include <netinet/sctp_var.h>
41#include <netinet/sctp_sysctl.h>
42#include <netinet/sctp.h>
43#include <netinet/sctp_uio.h>

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

105 }
106 n_inp = (struct sctp_inpcb *)so->so_pcb;
107 n_inp->sctp_flags = (SCTP_PCB_FLAGS_UDPTYPE |
108 SCTP_PCB_FLAGS_CONNECTED |
109 SCTP_PCB_FLAGS_IN_TCPPOOL | /* Turn on Blocking IO */
110 (SCTP_PCB_COPY_FLAGS & inp->sctp_flags));
111 n_inp->sctp_socket = so;
112 n_inp->sctp_features = inp->sctp_features;
36#include <netinet/sctp_os.h>
37#include <netinet/sctp_pcb.h>
38#include <netinet/sctputil.h>
39#include <netinet/sctp_var.h>
40#include <netinet/sctp_var.h>
41#include <netinet/sctp_sysctl.h>
42#include <netinet/sctp.h>
43#include <netinet/sctp_uio.h>

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

105 }
106 n_inp = (struct sctp_inpcb *)so->so_pcb;
107 n_inp->sctp_flags = (SCTP_PCB_FLAGS_UDPTYPE |
108 SCTP_PCB_FLAGS_CONNECTED |
109 SCTP_PCB_FLAGS_IN_TCPPOOL | /* Turn on Blocking IO */
110 (SCTP_PCB_COPY_FLAGS & inp->sctp_flags));
111 n_inp->sctp_socket = so;
112 n_inp->sctp_features = inp->sctp_features;
113 n_inp->sctp_mobility_features = inp->sctp_mobility_features;
113 n_inp->sctp_frag_point = inp->sctp_frag_point;
114 n_inp->partial_delivery_point = inp->partial_delivery_point;
115 n_inp->sctp_context = inp->sctp_context;
116 n_inp->inp_starting_point_for_iterator = NULL;
114 n_inp->sctp_frag_point = inp->sctp_frag_point;
115 n_inp->partial_delivery_point = inp->partial_delivery_point;
116 n_inp->sctp_context = inp->sctp_context;
117 n_inp->inp_starting_point_for_iterator = NULL;
117
118 /* copy in the authentication parameters from the original endpoint */
119 if (n_inp->sctp_ep.local_hmacs)
120 sctp_free_hmaclist(n_inp->sctp_ep.local_hmacs);
121 n_inp->sctp_ep.local_hmacs =
122 sctp_copy_hmaclist(inp->sctp_ep.local_hmacs);
123 if (n_inp->sctp_ep.local_auth_chunks)
124 sctp_free_chunklist(n_inp->sctp_ep.local_auth_chunks);
125 n_inp->sctp_ep.local_auth_chunks =
126 sctp_copy_chunklist(inp->sctp_ep.local_auth_chunks);
127 (void)sctp_copy_skeylist(&inp->sctp_ep.shared_keys,
128 &n_inp->sctp_ep.shared_keys);
118 /*
119 * Now we must move it from one hash table to another and get the
120 * stcb in the right place.
121 */
122 sctp_move_pcb_and_assoc(inp, n_inp, stcb);
123 atomic_add_int(&stcb->asoc.refcnt, 1);
124 SCTP_TCB_UNLOCK(stcb);
125

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

164 SOCK_LOCK(head);
165 SCTP_INP_WLOCK(inp);
166 SCTP_INP_WLOCK(n_inp);
167 n_inp->sctp_flags = (SCTP_PCB_FLAGS_UDPTYPE |
168 SCTP_PCB_FLAGS_CONNECTED |
169 SCTP_PCB_FLAGS_IN_TCPPOOL | /* Turn on Blocking IO */
170 (SCTP_PCB_COPY_FLAGS & inp->sctp_flags));
171 n_inp->sctp_features = inp->sctp_features;
129 /*
130 * Now we must move it from one hash table to another and get the
131 * stcb in the right place.
132 */
133 sctp_move_pcb_and_assoc(inp, n_inp, stcb);
134 atomic_add_int(&stcb->asoc.refcnt, 1);
135 SCTP_TCB_UNLOCK(stcb);
136

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

175 SOCK_LOCK(head);
176 SCTP_INP_WLOCK(inp);
177 SCTP_INP_WLOCK(n_inp);
178 n_inp->sctp_flags = (SCTP_PCB_FLAGS_UDPTYPE |
179 SCTP_PCB_FLAGS_CONNECTED |
180 SCTP_PCB_FLAGS_IN_TCPPOOL | /* Turn on Blocking IO */
181 (SCTP_PCB_COPY_FLAGS & inp->sctp_flags));
182 n_inp->sctp_features = inp->sctp_features;
183 n_inp->sctp_mobility_features = inp->sctp_mobility_features;
172 n_inp->sctp_frag_point = inp->sctp_frag_point;
173 n_inp->partial_delivery_point = inp->partial_delivery_point;
174 n_inp->sctp_context = inp->sctp_context;
175 n_inp->inp_starting_point_for_iterator = NULL;
176
177 /* copy in the authentication parameters from the original endpoint */
178 if (n_inp->sctp_ep.local_hmacs)
179 sctp_free_hmaclist(n_inp->sctp_ep.local_hmacs);

--- 47 unchanged lines hidden ---
184 n_inp->sctp_frag_point = inp->sctp_frag_point;
185 n_inp->partial_delivery_point = inp->partial_delivery_point;
186 n_inp->sctp_context = inp->sctp_context;
187 n_inp->inp_starting_point_for_iterator = NULL;
188
189 /* copy in the authentication parameters from the original endpoint */
190 if (n_inp->sctp_ep.local_hmacs)
191 sctp_free_hmaclist(n_inp->sctp_ep.local_hmacs);

--- 47 unchanged lines hidden ---