Deleted Added
full compact
sctp_pcb.c (283827) sctp_pcb.c (284633)
1/*-
2 * Copyright (c) 2001-2008, 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) 2001-2008, 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: stable/10/sys/netinet/sctp_pcb.c 283827 2015-05-31 12:59:22Z tuexen $");
34__FBSDID("$FreeBSD: stable/10/sys/netinet/sctp_pcb.c 284633 2015-06-20 08:25:27Z tuexen $");
35
36#include <netinet/sctp_os.h>
37#include <sys/proc.h>
38#include <netinet/sctp_var.h>
39#include <netinet/sctp_sysctl.h>
40#include <netinet/sctp_pcb.h>
41#include <netinet/sctputil.h>
42#include <netinet/sctp.h>

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

2484 inp->auth_supported = 0;
2485 } else {
2486 inp->auth_supported = 1;
2487 }
2488 inp->asconf_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_asconf_enable);
2489 inp->reconfig_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_reconfig_enable);
2490 inp->nrsack_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_nrsack_enable);
2491 inp->pktdrop_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_pktdrop_enable);
35
36#include <netinet/sctp_os.h>
37#include <sys/proc.h>
38#include <netinet/sctp_var.h>
39#include <netinet/sctp_sysctl.h>
40#include <netinet/sctp_pcb.h>
41#include <netinet/sctputil.h>
42#include <netinet/sctp.h>

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

2484 inp->auth_supported = 0;
2485 } else {
2486 inp->auth_supported = 1;
2487 }
2488 inp->asconf_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_asconf_enable);
2489 inp->reconfig_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_reconfig_enable);
2490 inp->nrsack_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_nrsack_enable);
2491 inp->pktdrop_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_pktdrop_enable);
2492 inp->fibnum = so->so_fibnum;
2492 /* init the small hash table we use to track asocid <-> tcb */
2493 inp->sctp_asocidhash = SCTP_HASH_INIT(SCTP_STACK_VTAG_HASH_SIZE, &inp->hashasocidmark);
2494 if (inp->sctp_asocidhash == NULL) {
2495 crfree(inp->ip_inp.inp.inp_cred);
2496 SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp);
2497 SCTP_INP_INFO_WUNLOCK();
2498 return (ENOBUFS);
2499 }

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

3948 if (newaddr->sa_family == AF_INET6) {
3949 struct sockaddr_in6 *sin6;
3950
3951 sin6 = (struct sockaddr_in6 *)&net->ro._l_addr;
3952 (void)sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone));
3953 sin6->sin6_scope_id = 0;
3954 }
3955#endif
2493 /* init the small hash table we use to track asocid <-> tcb */
2494 inp->sctp_asocidhash = SCTP_HASH_INIT(SCTP_STACK_VTAG_HASH_SIZE, &inp->hashasocidmark);
2495 if (inp->sctp_asocidhash == NULL) {
2496 crfree(inp->ip_inp.inp.inp_cred);
2497 SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp);
2498 SCTP_INP_INFO_WUNLOCK();
2499 return (ENOBUFS);
2500 }

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

3949 if (newaddr->sa_family == AF_INET6) {
3950 struct sockaddr_in6 *sin6;
3951
3952 sin6 = (struct sockaddr_in6 *)&net->ro._l_addr;
3953 (void)sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone));
3954 sin6->sin6_scope_id = 0;
3955 }
3956#endif
3956 SCTP_RTALLOC((sctp_route_t *) & net->ro, stcb->asoc.vrf_id);
3957 SCTP_RTALLOC((sctp_route_t *) & net->ro,
3958 stcb->asoc.vrf_id,
3959 stcb->sctp_ep->fibnum);
3957
3958 if (SCTP_ROUTE_HAS_VALID_IFN(&net->ro)) {
3959 /* Get source address */
3960 net->ro._s_addr = sctp_source_address_selection(stcb->sctp_ep,
3961 stcb,
3962 (sctp_route_t *) & net->ro,
3963 net,
3964 0,

--- 3070 unchanged lines hidden ---
3960
3961 if (SCTP_ROUTE_HAS_VALID_IFN(&net->ro)) {
3962 /* Get source address */
3963 net->ro._s_addr = sctp_source_address_selection(stcb->sctp_ep,
3964 stcb,
3965 (sctp_route_t *) & net->ro,
3966 net,
3967 0,

--- 3070 unchanged lines hidden ---