sctp_input.c (283822) | sctp_input.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_input.c 283822 2015-05-31 12:46:40Z tuexen $"); | 34__FBSDID("$FreeBSD: stable/10/sys/netinet/sctp_input.c 284633 2015-06-20 08:25:27Z tuexen $"); |
35 36#include <netinet/sctp_os.h> 37#include <netinet/sctp_var.h> 38#include <netinet/sctp_sysctl.h> 39#include <netinet/sctp_pcb.h> 40#include <netinet/sctp_header.h> 41#include <netinet/sctputil.h> 42#include <netinet/sctp_output.h> --- 138 unchanged lines hidden (view full) --- 181 * pay it on the chance that the app will actually do some 182 * accepts(). The App just looses and should NOT be in this 183 * state :-) 184 */ 185 if (SCTP_BASE_SYSCTL(sctp_blackhole) == 0) { 186 op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), 187 "No listener"); 188 sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, | 35 36#include <netinet/sctp_os.h> 37#include <netinet/sctp_var.h> 38#include <netinet/sctp_sysctl.h> 39#include <netinet/sctp_pcb.h> 40#include <netinet/sctp_header.h> 41#include <netinet/sctputil.h> 42#include <netinet/sctp_output.h> --- 138 unchanged lines hidden (view full) --- 181 * pay it on the chance that the app will actually do some 182 * accepts(). The App just looses and should NOT be in this 183 * state :-) 184 */ 185 if (SCTP_BASE_SYSCTL(sctp_blackhole) == 0) { 186 op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), 187 "No listener"); 188 sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, |
189 mflowtype, mflowid, | 189 mflowtype, mflowid, inp->fibnum, |
190 vrf_id, port); 191 } 192 goto outnow; 193 } 194 if ((stcb != NULL) && 195 (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT)) { 196 SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending SHUTDOWN-ACK\n"); 197 sctp_send_shutdown_ack(stcb, NULL); --- 1281 unchanged lines hidden (view full) --- 1479 if (how_indx < sizeof(asoc->cookie_how)) { 1480 asoc->cookie_how[how_indx] = 1; 1481 } 1482 if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) { 1483 /* SHUTDOWN came in after sending INIT-ACK */ 1484 sctp_send_shutdown_ack(stcb, stcb->asoc.primary_destination); 1485 op_err = sctp_generate_cause(SCTP_CAUSE_COOKIE_IN_SHUTDOWN, ""); 1486 sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, | 190 vrf_id, port); 191 } 192 goto outnow; 193 } 194 if ((stcb != NULL) && 195 (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT)) { 196 SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending SHUTDOWN-ACK\n"); 197 sctp_send_shutdown_ack(stcb, NULL); --- 1281 unchanged lines hidden (view full) --- 1479 if (how_indx < sizeof(asoc->cookie_how)) { 1480 asoc->cookie_how[how_indx] = 1; 1481 } 1482 if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) { 1483 /* SHUTDOWN came in after sending INIT-ACK */ 1484 sctp_send_shutdown_ack(stcb, stcb->asoc.primary_destination); 1485 op_err = sctp_generate_cause(SCTP_CAUSE_COOKIE_IN_SHUTDOWN, ""); 1486 sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, |
1487 mflowtype, mflowid, | 1487 mflowtype, mflowid, inp->fibnum, |
1488 vrf_id, net->port); 1489 if (how_indx < sizeof(asoc->cookie_how)) 1490 asoc->cookie_how[how_indx] = 2; 1491 return (NULL); 1492 } 1493 /* 1494 * find and validate the INIT chunk in the cookie (peer's info) the 1495 * INIT should start after the cookie-echo header struct (chunk --- 193 unchanged lines hidden (view full) --- 1689 * and we respond tag-a, we get a INIT from host-2 behind 1690 * the nat and we get tag-a again. Then we bring up host-1 1691 * (or 2's) assoc, Then comes the cookie from hsot-2 (or 1). 1692 * Now we have colliding state. We must send an abort here 1693 * with colliding state indication. 1694 */ 1695 op_err = sctp_generate_cause(SCTP_CAUSE_NAT_COLLIDING_STATE, ""); 1696 sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, | 1488 vrf_id, net->port); 1489 if (how_indx < sizeof(asoc->cookie_how)) 1490 asoc->cookie_how[how_indx] = 2; 1491 return (NULL); 1492 } 1493 /* 1494 * find and validate the INIT chunk in the cookie (peer's info) the 1495 * INIT should start after the cookie-echo header struct (chunk --- 193 unchanged lines hidden (view full) --- 1689 * and we respond tag-a, we get a INIT from host-2 behind 1690 * the nat and we get tag-a again. Then we bring up host-1 1691 * (or 2's) assoc, Then comes the cookie from hsot-2 (or 1). 1692 * Now we have colliding state. We must send an abort here 1693 * with colliding state indication. 1694 */ 1695 op_err = sctp_generate_cause(SCTP_CAUSE_NAT_COLLIDING_STATE, ""); 1696 sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, |
1697 mflowtype, mflowid, | 1697 mflowtype, mflowid, inp->fibnum, |
1698 vrf_id, port); 1699 return (NULL); 1700 } 1701 if ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) && 1702 ((ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) || 1703 (asoc->peer_vtag == 0))) { 1704 /* 1705 * case B in Section 5.2.4 Table 2: MXAA or MOAA my info --- 861 unchanged lines hidden (view full) --- 2567 (sizeof(uint32_t)))); 2568 /* seconds to usec */ 2569 tim = (now.tv_sec - time_expires.tv_sec) * 1000000; 2570 /* add in usec */ 2571 if (tim == 0) 2572 tim = now.tv_usec - cookie->time_entered.tv_usec; 2573 scm->time_usec = htonl(tim); 2574 sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, | 1698 vrf_id, port); 1699 return (NULL); 1700 } 1701 if ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) && 1702 ((ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) || 1703 (asoc->peer_vtag == 0))) { 1704 /* 1705 * case B in Section 5.2.4 Table 2: MXAA or MOAA my info --- 861 unchanged lines hidden (view full) --- 2567 (sizeof(uint32_t)))); 2568 /* seconds to usec */ 2569 tim = (now.tv_sec - time_expires.tv_sec) * 1000000; 2570 /* add in usec */ 2571 if (tim == 0) 2572 tim = now.tv_usec - cookie->time_entered.tv_usec; 2573 scm->time_usec = htonl(tim); 2574 sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, |
2575 mflowtype, mflowid, | 2575 mflowtype, mflowid, l_inp->fibnum, |
2576 vrf_id, port); 2577 return (NULL); 2578 } 2579 /* 2580 * Now we must see with the lookup address if we have an existing 2581 * asoc. This will only happen if we were in the COOKIE-WAIT state 2582 * and a INIT collided with us and somewhere the peer sent the 2583 * cookie on another address besides the single address our assoc --- 205 unchanged lines hidden (view full) --- 2789 inp->auth_supported = (*inp_p)->auth_supported; 2790 inp->asconf_supported = (*inp_p)->asconf_supported; 2791 inp->reconfig_supported = (*inp_p)->reconfig_supported; 2792 inp->nrsack_supported = (*inp_p)->nrsack_supported; 2793 inp->pktdrop_supported = (*inp_p)->pktdrop_supported; 2794 inp->partial_delivery_point = (*inp_p)->partial_delivery_point; 2795 inp->sctp_context = (*inp_p)->sctp_context; 2796 inp->local_strreset_support = (*inp_p)->local_strreset_support; | 2576 vrf_id, port); 2577 return (NULL); 2578 } 2579 /* 2580 * Now we must see with the lookup address if we have an existing 2581 * asoc. This will only happen if we were in the COOKIE-WAIT state 2582 * and a INIT collided with us and somewhere the peer sent the 2583 * cookie on another address besides the single address our assoc --- 205 unchanged lines hidden (view full) --- 2789 inp->auth_supported = (*inp_p)->auth_supported; 2790 inp->asconf_supported = (*inp_p)->asconf_supported; 2791 inp->reconfig_supported = (*inp_p)->reconfig_supported; 2792 inp->nrsack_supported = (*inp_p)->nrsack_supported; 2793 inp->pktdrop_supported = (*inp_p)->pktdrop_supported; 2794 inp->partial_delivery_point = (*inp_p)->partial_delivery_point; 2795 inp->sctp_context = (*inp_p)->sctp_context; 2796 inp->local_strreset_support = (*inp_p)->local_strreset_support; |
2797 inp->fibnum = (*inp_p)->fibnum; |
|
2797 inp->inp_starting_point_for_iterator = NULL; 2798 /* 2799 * copy in the authentication parameters from the 2800 * original endpoint 2801 */ 2802 if (inp->sctp_ep.local_hmacs) 2803 sctp_free_hmaclist(inp->sctp_ep.local_hmacs); 2804 inp->sctp_ep.local_hmacs = --- 1594 unchanged lines hidden (view full) --- 4399#ifdef __GNUC__ 4400__attribute__((noinline)) 4401#endif 4402 static struct sctp_tcb * 4403 sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, 4404 struct sockaddr *src, struct sockaddr *dst, 4405 struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp, 4406 struct sctp_tcb *stcb, struct sctp_nets **netp, int *fwd_tsn_seen, | 2798 inp->inp_starting_point_for_iterator = NULL; 2799 /* 2800 * copy in the authentication parameters from the 2801 * original endpoint 2802 */ 2803 if (inp->sctp_ep.local_hmacs) 2804 sctp_free_hmaclist(inp->sctp_ep.local_hmacs); 2805 inp->sctp_ep.local_hmacs = --- 1594 unchanged lines hidden (view full) --- 4400#ifdef __GNUC__ 4401__attribute__((noinline)) 4402#endif 4403 static struct sctp_tcb * 4404 sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, 4405 struct sockaddr *src, struct sockaddr *dst, 4406 struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp, 4407 struct sctp_tcb *stcb, struct sctp_nets **netp, int *fwd_tsn_seen, |
4407 uint8_t mflowtype, uint32_t mflowid, | 4408 uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum, |
4408 uint32_t vrf_id, uint16_t port) 4409{ 4410 struct sctp_association *asoc; 4411 struct mbuf *op_err; 4412 char msg[SCTP_DIAG_INFO_LEN]; 4413 uint32_t vtag_in; 4414 int num_chunks = 0; /* number of control chunks processed */ 4415 uint32_t chk_length; --- 147 unchanged lines hidden (view full) --- 4563 } 4564 } 4565 if (stcb == NULL) { 4566 snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__); 4567 op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), 4568 msg); 4569 /* no association, so it's out of the blue... */ 4570 sctp_handle_ootb(m, iphlen, *offset, src, dst, sh, inp, op_err, | 4409 uint32_t vrf_id, uint16_t port) 4410{ 4411 struct sctp_association *asoc; 4412 struct mbuf *op_err; 4413 char msg[SCTP_DIAG_INFO_LEN]; 4414 uint32_t vtag_in; 4415 int num_chunks = 0; /* number of control chunks processed */ 4416 uint32_t chk_length; --- 147 unchanged lines hidden (view full) --- 4564 } 4565 } 4566 if (stcb == NULL) { 4567 snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__); 4568 op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), 4569 msg); 4570 /* no association, so it's out of the blue... */ 4571 sctp_handle_ootb(m, iphlen, *offset, src, dst, sh, inp, op_err, |
4571 mflowtype, mflowid, | 4572 mflowtype, mflowid, inp->fibnum, |
4572 vrf_id, port); 4573 *offset = length; 4574 if (locked_tcb) { 4575 SCTP_TCB_UNLOCK(locked_tcb); 4576 } 4577 return (NULL); 4578 } 4579 asoc = &stcb->asoc; --- 27 unchanged lines hidden (view full) --- 4607 if (locked_tcb) { 4608 SCTP_TCB_UNLOCK(locked_tcb); 4609 } 4610 snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__); 4611 op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), 4612 msg); 4613 sctp_handle_ootb(m, iphlen, *offset, src, dst, 4614 sh, inp, op_err, | 4573 vrf_id, port); 4574 *offset = length; 4575 if (locked_tcb) { 4576 SCTP_TCB_UNLOCK(locked_tcb); 4577 } 4578 return (NULL); 4579 } 4580 asoc = &stcb->asoc; --- 27 unchanged lines hidden (view full) --- 4608 if (locked_tcb) { 4609 SCTP_TCB_UNLOCK(locked_tcb); 4610 } 4611 snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__); 4612 op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), 4613 msg); 4614 sctp_handle_ootb(m, iphlen, *offset, src, dst, 4615 sh, inp, op_err, |
4615 mflowtype, mflowid, | 4616 mflowtype, mflowid, fibnum, |
4616 vrf_id, port); 4617 return (NULL); 4618 } 4619 } else { 4620 /* for all other chunks, vtag must match */ 4621 if (vtag_in != asoc->my_vtag) { 4622 /* invalid vtag... */ 4623 SCTPDBG(SCTP_DEBUG_INPUT3, --- 993 unchanged lines hidden (view full) --- 5617void 5618sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, 5619 struct sockaddr *src, struct sockaddr *dst, 5620 struct sctphdr *sh, struct sctp_chunkhdr *ch, 5621#if !defined(SCTP_WITH_NO_CSUM) 5622 uint8_t compute_crc, 5623#endif 5624 uint8_t ecn_bits, | 4617 vrf_id, port); 4618 return (NULL); 4619 } 4620 } else { 4621 /* for all other chunks, vtag must match */ 4622 if (vtag_in != asoc->my_vtag) { 4623 /* invalid vtag... */ 4624 SCTPDBG(SCTP_DEBUG_INPUT3, --- 993 unchanged lines hidden (view full) --- 5618void 5619sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, 5620 struct sockaddr *src, struct sockaddr *dst, 5621 struct sctphdr *sh, struct sctp_chunkhdr *ch, 5622#if !defined(SCTP_WITH_NO_CSUM) 5623 uint8_t compute_crc, 5624#endif 5625 uint8_t ecn_bits, |
5625 uint8_t mflowtype, uint32_t mflowid, | 5626 uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum, |
5626 uint32_t vrf_id, uint16_t port) 5627{ 5628 uint32_t high_tsn; 5629 int fwd_tsn_seen = 0, data_processed = 0; 5630 struct mbuf *m = *mm, *op_err; 5631 char msg[SCTP_DIAG_INFO_LEN]; 5632 int un_sent; 5633 int cnt_ctrl_ready = 0; --- 62 unchanged lines hidden (view full) --- 5696 } 5697 if (inp == NULL) { 5698 SCTP_STAT_INCR(sctps_noport); 5699 if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) { 5700 goto out; 5701 } 5702 if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { 5703 sctp_send_shutdown_complete2(src, dst, sh, | 5627 uint32_t vrf_id, uint16_t port) 5628{ 5629 uint32_t high_tsn; 5630 int fwd_tsn_seen = 0, data_processed = 0; 5631 struct mbuf *m = *mm, *op_err; 5632 char msg[SCTP_DIAG_INFO_LEN]; 5633 int un_sent; 5634 int cnt_ctrl_ready = 0; --- 62 unchanged lines hidden (view full) --- 5697 } 5698 if (inp == NULL) { 5699 SCTP_STAT_INCR(sctps_noport); 5700 if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) { 5701 goto out; 5702 } 5703 if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { 5704 sctp_send_shutdown_complete2(src, dst, sh, |
5704 mflowtype, mflowid, | 5705 mflowtype, mflowid, fibnum, |
5705 vrf_id, port); 5706 goto out; 5707 } 5708 if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { 5709 goto out; 5710 } 5711 if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { 5712 if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || 5713 ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && 5714 (ch->chunk_type != SCTP_INIT))) { 5715 op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), 5716 "Out of the blue"); 5717 sctp_send_abort(m, iphlen, src, dst, 5718 sh, 0, op_err, | 5706 vrf_id, port); 5707 goto out; 5708 } 5709 if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { 5710 goto out; 5711 } 5712 if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { 5713 if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || 5714 ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && 5715 (ch->chunk_type != SCTP_INIT))) { 5716 op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), 5717 "Out of the blue"); 5718 sctp_send_abort(m, iphlen, src, dst, 5719 sh, 0, op_err, |
5719 mflowtype, mflowid, | 5720 mflowtype, mflowid, fibnum, |
5720 vrf_id, port); 5721 } 5722 } 5723 goto out; 5724 } else if (stcb == NULL) { 5725 inp_decr = inp; 5726 } 5727#ifdef IPSEC --- 44 unchanged lines hidden (view full) --- 5772 * NOT respond to any packet.. its OOTB. 5773 */ 5774 SCTP_TCB_UNLOCK(stcb); 5775 stcb = NULL; 5776 snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__); 5777 op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), 5778 msg); 5779 sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, | 5721 vrf_id, port); 5722 } 5723 } 5724 goto out; 5725 } else if (stcb == NULL) { 5726 inp_decr = inp; 5727 } 5728#ifdef IPSEC --- 44 unchanged lines hidden (view full) --- 5773 * NOT respond to any packet.. its OOTB. 5774 */ 5775 SCTP_TCB_UNLOCK(stcb); 5776 stcb = NULL; 5777 snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__); 5778 op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), 5779 msg); 5780 sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, |
5780 mflowtype, mflowid, | 5781 mflowtype, mflowid, inp->fibnum, |
5781 vrf_id, port); 5782 goto out; 5783 } 5784 } 5785 if (IS_SCTP_CONTROL(ch)) { 5786 /* process the control portion of the SCTP packet */ 5787 /* sa_ignore NO_NULL_CHK */ 5788 stcb = sctp_process_control(m, iphlen, &offset, length, 5789 src, dst, sh, ch, 5790 inp, stcb, &net, &fwd_tsn_seen, | 5782 vrf_id, port); 5783 goto out; 5784 } 5785 } 5786 if (IS_SCTP_CONTROL(ch)) { 5787 /* process the control portion of the SCTP packet */ 5788 /* sa_ignore NO_NULL_CHK */ 5789 stcb = sctp_process_control(m, iphlen, &offset, length, 5790 src, dst, sh, ch, 5791 inp, stcb, &net, &fwd_tsn_seen, |
5791 mflowtype, mflowid, | 5792 mflowtype, mflowid, fibnum, |
5792 vrf_id, port); 5793 if (stcb) { 5794 /* 5795 * This covers us if the cookie-echo was there and 5796 * it changes our INP. 5797 */ 5798 inp = stcb->sctp_ep; 5799#if defined(INET) || defined(INET6) --- 24 unchanged lines hidden (view full) --- 5824 goto out; 5825 } 5826 if (stcb == NULL) { 5827 /* out of the blue DATA chunk */ 5828 snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__); 5829 op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), 5830 msg); 5831 sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, | 5793 vrf_id, port); 5794 if (stcb) { 5795 /* 5796 * This covers us if the cookie-echo was there and 5797 * it changes our INP. 5798 */ 5799 inp = stcb->sctp_ep; 5800#if defined(INET) || defined(INET6) --- 24 unchanged lines hidden (view full) --- 5825 goto out; 5826 } 5827 if (stcb == NULL) { 5828 /* out of the blue DATA chunk */ 5829 snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__); 5830 op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), 5831 msg); 5832 sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, |
5832 mflowtype, mflowid, | 5833 mflowtype, mflowid, fibnum, |
5833 vrf_id, port); 5834 goto out; 5835 } 5836 if (stcb->asoc.my_vtag != ntohl(sh->v_tag)) { 5837 /* v_tag mismatch! */ 5838 SCTP_STAT_INCR(sctps_badvtag); 5839 goto out; 5840 } --- 55 unchanged lines hidden (view full) --- 5896 case SCTP_STATE_COOKIE_WAIT: 5897 /* 5898 * We consider OOTB any data sent during asoc setup. 5899 */ 5900 snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__); 5901 op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), 5902 msg); 5903 sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, | 5834 vrf_id, port); 5835 goto out; 5836 } 5837 if (stcb->asoc.my_vtag != ntohl(sh->v_tag)) { 5838 /* v_tag mismatch! */ 5839 SCTP_STAT_INCR(sctps_badvtag); 5840 goto out; 5841 } --- 55 unchanged lines hidden (view full) --- 5897 case SCTP_STATE_COOKIE_WAIT: 5898 /* 5899 * We consider OOTB any data sent during asoc setup. 5900 */ 5901 snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__); 5902 op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), 5903 msg); 5904 sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, |
5904 mflowtype, mflowid, | 5905 mflowtype, mflowid, inp->fibnum, |
5905 vrf_id, port); 5906 goto out; 5907 /* sa_ignore NOTREACHED */ 5908 break; 5909 case SCTP_STATE_EMPTY: /* should not happen */ 5910 case SCTP_STATE_INUSE: /* should not happen */ 5911 case SCTP_STATE_SHUTDOWN_RECEIVED: /* This is a peer error */ 5912 case SCTP_STATE_SHUTDOWN_ACK_SENT: --- 120 unchanged lines hidden (view full) --- 6033 int length, offset; 6034 6035#if !defined(SCTP_WITH_NO_CSUM) 6036 uint8_t compute_crc; 6037 6038#endif 6039 uint32_t mflowid; 6040 uint8_t mflowtype; | 5906 vrf_id, port); 5907 goto out; 5908 /* sa_ignore NOTREACHED */ 5909 break; 5910 case SCTP_STATE_EMPTY: /* should not happen */ 5911 case SCTP_STATE_INUSE: /* should not happen */ 5912 case SCTP_STATE_SHUTDOWN_RECEIVED: /* This is a peer error */ 5913 case SCTP_STATE_SHUTDOWN_ACK_SENT: --- 120 unchanged lines hidden (view full) --- 6034 int length, offset; 6035 6036#if !defined(SCTP_WITH_NO_CSUM) 6037 uint8_t compute_crc; 6038 6039#endif 6040 uint32_t mflowid; 6041 uint8_t mflowtype; |
6042 uint16_t fibnum; |
|
6041 6042 iphlen = off; 6043 if (SCTP_GET_PKT_VRFID(i_pak, vrf_id)) { 6044 SCTP_RELEASE_PKT(i_pak); 6045 return; 6046 } 6047 m = SCTP_HEADER_TO_CHAIN(i_pak); 6048#ifdef SCTP_MBUF_LOGGING --- 9 unchanged lines hidden (view full) --- 6058#endif 6059 SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, 6060 "sctp_input(): Packet of length %d received on %s with csum_flags 0x%b.\n", 6061 m->m_pkthdr.len, 6062 if_name(m->m_pkthdr.rcvif), 6063 (int)m->m_pkthdr.csum_flags, CSUM_BITS); 6064 mflowid = m->m_pkthdr.flowid; 6065 mflowtype = M_HASHTYPE_GET(m); | 6043 6044 iphlen = off; 6045 if (SCTP_GET_PKT_VRFID(i_pak, vrf_id)) { 6046 SCTP_RELEASE_PKT(i_pak); 6047 return; 6048 } 6049 m = SCTP_HEADER_TO_CHAIN(i_pak); 6050#ifdef SCTP_MBUF_LOGGING --- 9 unchanged lines hidden (view full) --- 6060#endif 6061 SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, 6062 "sctp_input(): Packet of length %d received on %s with csum_flags 0x%b.\n", 6063 m->m_pkthdr.len, 6064 if_name(m->m_pkthdr.rcvif), 6065 (int)m->m_pkthdr.csum_flags, CSUM_BITS); 6066 mflowid = m->m_pkthdr.flowid; 6067 mflowtype = M_HASHTYPE_GET(m); |
6068 fibnum = M_GETFIB(m); |
|
6066 SCTP_STAT_INCR(sctps_recvpackets); 6067 SCTP_STAT_INCR_COUNTER64(sctps_inpackets); 6068 /* Get IP, SCTP, and first chunk header together in the first mbuf. */ 6069 offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); 6070 if (SCTP_BUF_LEN(m) < offset) { 6071 if ((m = m_pullup(m, offset)) == NULL) { 6072 SCTP_STAT_INCR(sctps_hdrops); 6073 return; --- 43 unchanged lines hidden (view full) --- 6117 sctp_common_input_processing(&m, iphlen, offset, length, 6118 (struct sockaddr *)&src, 6119 (struct sockaddr *)&dst, 6120 sh, ch, 6121#if !defined(SCTP_WITH_NO_CSUM) 6122 compute_crc, 6123#endif 6124 ecn_bits, | 6069 SCTP_STAT_INCR(sctps_recvpackets); 6070 SCTP_STAT_INCR_COUNTER64(sctps_inpackets); 6071 /* Get IP, SCTP, and first chunk header together in the first mbuf. */ 6072 offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); 6073 if (SCTP_BUF_LEN(m) < offset) { 6074 if ((m = m_pullup(m, offset)) == NULL) { 6075 SCTP_STAT_INCR(sctps_hdrops); 6076 return; --- 43 unchanged lines hidden (view full) --- 6120 sctp_common_input_processing(&m, iphlen, offset, length, 6121 (struct sockaddr *)&src, 6122 (struct sockaddr *)&dst, 6123 sh, ch, 6124#if !defined(SCTP_WITH_NO_CSUM) 6125 compute_crc, 6126#endif 6127 ecn_bits, |
6125 mflowtype, mflowid, | 6128 mflowtype, mflowid, fibnum, |
6126 vrf_id, port); 6127out: 6128 if (m) { 6129 sctp_m_freem(m); 6130 } 6131 return; 6132} 6133 --- 46 unchanged lines hidden --- | 6129 vrf_id, port); 6130out: 6131 if (m) { 6132 sctp_m_freem(m); 6133 } 6134 return; 6135} 6136 --- 46 unchanged lines hidden --- |