sctp_indata.c (168859) | sctp_indata.c (168943) |
---|---|
1/*- 2 * Copyright (c) 2001-2007, 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. --- 17 unchanged lines hidden (view full) --- 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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/* $KAME: sctp_indata.c,v 1.36 2005/03/06 16:04:17 itojun Exp $ */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2007, 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. --- 17 unchanged lines hidden (view full) --- 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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/* $KAME: sctp_indata.c,v 1.36 2005/03/06 16:04:17 itojun Exp $ */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_indata.c 168859 2007-04-19 11:28:43Z rrs $"); | 34__FBSDID("$FreeBSD: head/sys/netinet/sctp_indata.c 168943 2007-04-22 11:06:27Z rrs $"); |
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> --- 163 unchanged lines hidden (view full) --- 206 atomic_add_int(&net->ref_count, 1); 207 read_queue_e->data = dm; 208 read_queue_e->spec_flags = 0; 209 read_queue_e->tail_mbuf = NULL; 210 read_queue_e->stcb = stcb; 211 read_queue_e->port_from = stcb->rport; 212 read_queue_e->do_not_ref_stcb = 0; 213 read_queue_e->end_added = 0; | 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> --- 163 unchanged lines hidden (view full) --- 206 atomic_add_int(&net->ref_count, 1); 207 read_queue_e->data = dm; 208 read_queue_e->spec_flags = 0; 209 read_queue_e->tail_mbuf = NULL; 210 read_queue_e->stcb = stcb; 211 read_queue_e->port_from = stcb->rport; 212 read_queue_e->do_not_ref_stcb = 0; 213 read_queue_e->end_added = 0; |
214 read_queue_e->some_taken = 0; |
|
214 read_queue_e->pdapi_aborted = 0; 215failed_build: 216 return (read_queue_e); 217} 218 219 220/* 221 * Build out our readq entry based on the incoming packet. --- 22 unchanged lines hidden (view full) --- 244 atomic_add_int(&chk->whoTo->ref_count, 1); 245 read_queue_e->data = chk->data; 246 read_queue_e->tail_mbuf = NULL; 247 read_queue_e->stcb = stcb; 248 read_queue_e->port_from = stcb->rport; 249 read_queue_e->spec_flags = 0; 250 read_queue_e->do_not_ref_stcb = 0; 251 read_queue_e->end_added = 0; | 215 read_queue_e->pdapi_aborted = 0; 216failed_build: 217 return (read_queue_e); 218} 219 220 221/* 222 * Build out our readq entry based on the incoming packet. --- 22 unchanged lines hidden (view full) --- 245 atomic_add_int(&chk->whoTo->ref_count, 1); 246 read_queue_e->data = chk->data; 247 read_queue_e->tail_mbuf = NULL; 248 read_queue_e->stcb = stcb; 249 read_queue_e->port_from = stcb->rport; 250 read_queue_e->spec_flags = 0; 251 read_queue_e->do_not_ref_stcb = 0; 252 read_queue_e->end_added = 0; |
253 read_queue_e->some_taken = 0; |
|
252 read_queue_e->pdapi_aborted = 0; 253failed_build: 254 return (read_queue_e); 255} 256 257 258struct mbuf * 259sctp_build_ctl_nchunk(struct sctp_inpcb *inp, --- 5545 unchanged lines hidden (view full) --- 5805 sctp_free_a_chunk(stcb, chk); 5806 } else { 5807 /* 5808 * Ok we have gone beyond the end of the 5809 * fwd-tsn's mark. Some checks... 5810 */ 5811 if ((asoc->fragmented_delivery_inprogress) && 5812 (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG)) { | 254 read_queue_e->pdapi_aborted = 0; 255failed_build: 256 return (read_queue_e); 257} 258 259 260struct mbuf * 261sctp_build_ctl_nchunk(struct sctp_inpcb *inp, --- 5545 unchanged lines hidden (view full) --- 5807 sctp_free_a_chunk(stcb, chk); 5808 } else { 5809 /* 5810 * Ok we have gone beyond the end of the 5811 * fwd-tsn's mark. Some checks... 5812 */ 5813 if ((asoc->fragmented_delivery_inprogress) && 5814 (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG)) { |
5815 uint32_t str_seq; 5816 |
|
5813 /* 5814 * Special case PD-API is up and 5815 * what we fwd-tsn' over includes 5816 * one that had the LAST_FRAG. We no 5817 * longer need to do the PD-API. 5818 */ 5819 asoc->fragmented_delivery_inprogress = 0; | 5817 /* 5818 * Special case PD-API is up and 5819 * what we fwd-tsn' over includes 5820 * one that had the LAST_FRAG. We no 5821 * longer need to do the PD-API. 5822 */ 5823 asoc->fragmented_delivery_inprogress = 0; |
5824 5825 str_seq = (asoc->str_of_pdapi << 16) | asoc->ssn_of_pdapi; |
|
5820 sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, | 5826 sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, |
5821 stcb, SCTP_PARTIAL_DELIVERY_ABORTED, (void *)NULL); | 5827 stcb, SCTP_PARTIAL_DELIVERY_ABORTED, (void *)&str_seq); |
5822 5823 } 5824 break; 5825 } 5826 chk = at; 5827 } 5828 } 5829 if (asoc->fragmented_delivery_inprogress) { 5830 /* 5831 * Ok we removed cnt_gone chunks in the PD-API queue that 5832 * were being delivered. So now we must turn off the flag. 5833 */ | 5828 5829 } 5830 break; 5831 } 5832 chk = at; 5833 } 5834 } 5835 if (asoc->fragmented_delivery_inprogress) { 5836 /* 5837 * Ok we removed cnt_gone chunks in the PD-API queue that 5838 * were being delivered. So now we must turn off the flag. 5839 */ |
5840 uint32_t str_seq; 5841 5842 str_seq = (asoc->str_of_pdapi << 16) | asoc->ssn_of_pdapi; |
|
5834 sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, | 5843 sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, |
5835 stcb, SCTP_PARTIAL_DELIVERY_ABORTED, (void *)NULL); | 5844 stcb, SCTP_PARTIAL_DELIVERY_ABORTED, (void *)&str_seq); |
5836 asoc->fragmented_delivery_inprogress = 0; 5837 } 5838 /*************************************************************/ 5839 /* 3. Update the PR-stream re-ordering queues */ 5840 /*************************************************************/ 5841 stseq = (struct sctp_strseq *)((caddr_t)fwd + sizeof(*fwd)); 5842 fwd_sz -= sizeof(*fwd); 5843 { --- 40 unchanged lines hidden --- | 5845 asoc->fragmented_delivery_inprogress = 0; 5846 } 5847 /*************************************************************/ 5848 /* 3. Update the PR-stream re-ordering queues */ 5849 /*************************************************************/ 5850 stseq = (struct sctp_strseq *)((caddr_t)fwd + sizeof(*fwd)); 5851 fwd_sz -= sizeof(*fwd); 5852 { --- 40 unchanged lines hidden --- |