sctp_indata.c (168731) | sctp_indata.c (168859) |
---|---|
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 168731 2007-04-14 18:27:34Z mlaier $"); | 34__FBSDID("$FreeBSD: head/sys/netinet/sctp_indata.c 168859 2007-04-19 11:28:43Z 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> --- 1560 unchanged lines hidden (view full) --- 1603 * only validate the FIRST fragment so the bit must be set. 1604 */ 1605 strmseq = ntohs(ch->dp.stream_sequence); 1606 1607#ifdef SCTP_ASOCLOG_OF_TSNS 1608 asoc->in_tsnlog[asoc->tsn_in_at].tsn = tsn; 1609 asoc->in_tsnlog[asoc->tsn_in_at].strm = strmno; 1610 asoc->in_tsnlog[asoc->tsn_in_at].seq = strmseq; | 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> --- 1560 unchanged lines hidden (view full) --- 1603 * only validate the FIRST fragment so the bit must be set. 1604 */ 1605 strmseq = ntohs(ch->dp.stream_sequence); 1606 1607#ifdef SCTP_ASOCLOG_OF_TSNS 1608 asoc->in_tsnlog[asoc->tsn_in_at].tsn = tsn; 1609 asoc->in_tsnlog[asoc->tsn_in_at].strm = strmno; 1610 asoc->in_tsnlog[asoc->tsn_in_at].seq = strmseq; |
1611 asoc->in_tsnlog[asoc->tsn_in_at].sz = chk_length; 1612 asoc->in_tsnlog[asoc->tsn_in_at].flgs = chunk_flags; |
|
1611 asoc->tsn_in_at++; 1612 if (asoc->tsn_in_at >= SCTP_TSN_LOG_SIZE) { 1613 asoc->tsn_in_at = 0; | 1613 asoc->tsn_in_at++; 1614 if (asoc->tsn_in_at >= SCTP_TSN_LOG_SIZE) { 1615 asoc->tsn_in_at = 0; |
1616 asoc->tsn_in_wrapped = 1; |
|
1614 } 1615#endif 1616 if ((chunk_flags & SCTP_DATA_FIRST_FRAG) && 1617 (chunk_flags & SCTP_DATA_UNORDERED) == 0 && 1618 (compare_with_wrap(asoc->strmin[strmno].last_sequence_delivered, 1619 strmseq, MAX_SEQ) || 1620 asoc->strmin[strmno].last_sequence_delivered == strmseq)) { 1621 /* The incoming sseq is behind where we last delivered? */ --- 2450 unchanged lines hidden (view full) --- 4072 } else if (chk->sent < SCTP_DATAGRAM_ACKED) { 4073 inbetween++; 4074 } else if (chk->sent > SCTP_DATAGRAM_ACKED) { 4075 above++; 4076 } else { 4077 acked++; 4078 } 4079 } | 1617 } 1618#endif 1619 if ((chunk_flags & SCTP_DATA_FIRST_FRAG) && 1620 (chunk_flags & SCTP_DATA_UNORDERED) == 0 && 1621 (compare_with_wrap(asoc->strmin[strmno].last_sequence_delivered, 1622 strmseq, MAX_SEQ) || 1623 asoc->strmin[strmno].last_sequence_delivered == strmseq)) { 1624 /* The incoming sseq is behind where we last delivered? */ --- 2450 unchanged lines hidden (view full) --- 4075 } else if (chk->sent < SCTP_DATAGRAM_ACKED) { 4076 inbetween++; 4077 } else if (chk->sent > SCTP_DATAGRAM_ACKED) { 4078 above++; 4079 } else { 4080 acked++; 4081 } 4082 } |
4083 |
|
4080 if ((inflight > 0) || (inbetween > 0)) { | 4084 if ((inflight > 0) || (inbetween > 0)) { |
4085#ifdef INVARIANTS |
|
4081 panic("Flight size-express incorrect? \n"); | 4086 panic("Flight size-express incorrect? \n"); |
4087#else 4088 printf("Flight size-express incorrect inflight:%d inbetween:%d\n", 4089 inflight, inbetween); 4090#endif |
|
4082 } 4083} 4084 4085 4086static void 4087sctp_window_probe_recovery(struct sctp_tcb *stcb, 4088 struct sctp_association *asoc, 4089 struct sctp_nets *net, --- 891 unchanged lines hidden (view full) --- 4981 */ 4982 4983 if (tp1->pr_sctp_on) { 4984 if (asoc->pr_sctp_cnt != 0) 4985 asoc->pr_sctp_cnt--; 4986 } 4987 if ((TAILQ_FIRST(&asoc->sent_queue) == NULL) && 4988 (asoc->total_flight > 0)) { | 4091 } 4092} 4093 4094 4095static void 4096sctp_window_probe_recovery(struct sctp_tcb *stcb, 4097 struct sctp_association *asoc, 4098 struct sctp_nets *net, --- 891 unchanged lines hidden (view full) --- 4990 */ 4991 4992 if (tp1->pr_sctp_on) { 4993 if (asoc->pr_sctp_cnt != 0) 4994 asoc->pr_sctp_cnt--; 4995 } 4996 if ((TAILQ_FIRST(&asoc->sent_queue) == NULL) && 4997 (asoc->total_flight > 0)) { |
4998#ifdef INVARIANTS |
|
4989 panic("Warning flight size is postive and should be 0"); | 4999 panic("Warning flight size is postive and should be 0"); |
4990/* 4991 printf("Warning flight size incorrect should be 0 is %d\n", 4992 asoc->total_flight); 4993*/ | 5000#else 5001 5002 printf("Warning flight size incorrect should be 0 is %d\n", 5003 asoc->total_flight); 5004#endif |
4994 asoc->total_flight = 0; 4995 } 4996 if (tp1->data) { 4997 sctp_free_bufspace(stcb, asoc, tp1, 1); 4998 sctp_m_freem(tp1->data); 4999 if (PR_SCTP_BUF_ENABLED(tp1->flags)) { 5000 asoc->sent_queue_cnt_removeable--; 5001 } --- 871 unchanged lines hidden --- | 5005 asoc->total_flight = 0; 5006 } 5007 if (tp1->data) { 5008 sctp_free_bufspace(stcb, asoc, tp1, 1); 5009 sctp_m_freem(tp1->data); 5010 if (PR_SCTP_BUF_ENABLED(tp1->flags)) { 5011 asoc->sent_queue_cnt_removeable--; 5012 } --- 871 unchanged lines hidden --- |