Deleted Added
full compact
sctp_sysctl.c (243186) sctp_sysctl.c (246595)
1/*-
2 * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved.
3 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
4 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 *

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

26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved.
3 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
4 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 *

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

26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_sysctl.c 243186 2012-11-17 20:04:04Z tuexen $");
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_sysctl.c 246595 2013-02-09 17:26:14Z tuexen $");
35
36#include <netinet/sctp_os.h>
37#include <netinet/sctp.h>
38#include <netinet/sctp_constants.h>
39#include <netinet/sctp_sysctl.h>
40#include <netinet/sctp_pcb.h>
41#include <netinet/sctputil.h>
42#include <netinet/sctp_output.h>

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

192 struct sctp_vrf *vrf;
193 struct xsctp_laddr xladdr;
194 struct sctp_laddr *laddr;
195 int error;
196
197 /* Turn on all the appropriate scope */
198 if (stcb) {
199 /* use association specific values */
35
36#include <netinet/sctp_os.h>
37#include <netinet/sctp.h>
38#include <netinet/sctp_constants.h>
39#include <netinet/sctp_sysctl.h>
40#include <netinet/sctp_pcb.h>
41#include <netinet/sctputil.h>
42#include <netinet/sctp_output.h>

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

192 struct sctp_vrf *vrf;
193 struct xsctp_laddr xladdr;
194 struct sctp_laddr *laddr;
195 int error;
196
197 /* Turn on all the appropriate scope */
198 if (stcb) {
199 /* use association specific values */
200 loopback_scope = stcb->asoc.loopback_scope;
201 ipv4_local_scope = stcb->asoc.ipv4_local_scope;
202 local_scope = stcb->asoc.local_scope;
203 site_scope = stcb->asoc.site_scope;
200 loopback_scope = stcb->asoc.scope.loopback_scope;
201 ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope;
202 local_scope = stcb->asoc.scope.local_scope;
203 site_scope = stcb->asoc.scope.site_scope;
204 ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal;
205 ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal;
204 } else {
206 } else {
205 /* use generic values for endpoints */
207 /* Use generic values for endpoints. */
206 loopback_scope = 1;
207 ipv4_local_scope = 1;
208 local_scope = 1;
209 site_scope = 1;
208 loopback_scope = 1;
209 ipv4_local_scope = 1;
210 local_scope = 1;
211 site_scope = 1;
210 }
211
212 /* use only address families of interest */
213 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
214 ipv6_addr_legal = 1;
215 if (SCTP_IPV6_V6ONLY(inp)) {
216 ipv4_addr_legal = 0;
212 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
213 ipv6_addr_legal = 1;
214 if (SCTP_IPV6_V6ONLY(inp)) {
215 ipv4_addr_legal = 0;
216 } else {
217 ipv4_addr_legal = 1;
218 }
217 } else {
219 } else {
220 ipv6_addr_legal = 0;
218 ipv4_addr_legal = 1;
219 }
221 ipv4_addr_legal = 1;
222 }
220 } else {
221 ipv4_addr_legal = 1;
222 ipv6_addr_legal = 0;
223 }
224
225 /* neither Mac OS X nor FreeBSD support mulitple routing functions */
226 if ((vrf = sctp_find_vrf(inp->def_vrf_id)) == NULL) {
227 SCTP_INP_RUNLOCK(inp);
228 SCTP_INP_INFO_RUNLOCK();
229 return (-1);
230 }

--- 910 unchanged lines hidden ---
223 }
224
225 /* neither Mac OS X nor FreeBSD support mulitple routing functions */
226 if ((vrf = sctp_find_vrf(inp->def_vrf_id)) == NULL) {
227 SCTP_INP_RUNLOCK(inp);
228 SCTP_INP_INFO_RUNLOCK();
229 return (-1);
230 }

--- 910 unchanged lines hidden ---