sctp_output.c (210495) | sctp_output.c (210599) |
---|---|
1/*- 2 * Copyright (c) 2001-2008, by 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_output.c,v 1.46 2005/03/06 16:04:17 itojun Exp $ */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2008, by 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_output.c,v 1.46 2005/03/06 16:04:17 itojun Exp $ */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 210495 2010-07-26 09:26:55Z tuexen $"); | 34__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 210599 2010-07-29 11:37:04Z rrs $"); |
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_header.h> 41#include <netinet/sctp_pcb.h> 42#include <netinet/sctputil.h> --- 6531 unchanged lines hidden (view full) --- 6574 /* Stray chunks must be cleaned up */ 6575 clean_up_anyway: 6576 TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next); 6577 if (chk->data) { 6578 sctp_m_freem(chk->data); 6579 chk->data = NULL; 6580 } 6581 asoc->ctrl_queue_cnt--; | 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_header.h> 41#include <netinet/sctp_pcb.h> 42#include <netinet/sctputil.h> --- 6531 unchanged lines hidden (view full) --- 6574 /* Stray chunks must be cleaned up */ 6575 clean_up_anyway: 6576 TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next); 6577 if (chk->data) { 6578 sctp_m_freem(chk->data); 6579 chk->data = NULL; 6580 } 6581 asoc->ctrl_queue_cnt--; |
6582 if (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN) 6583 asoc->fwd_tsn_cnt--; |
|
6582 sctp_free_a_chunk(stcb, chk); 6583 } else if (chk->rec.chunk_id.id == SCTP_STREAM_RESET) { 6584 /* special handling, we must look into the param */ 6585 if (chk != asoc->str_reset) { 6586 goto clean_up_anyway; 6587 } 6588 } 6589 } --- 1204 unchanged lines hidden (view full) --- 7794 */ 7795 if ((auth == NULL) && 7796 sctp_auth_is_required_chunk(chk->rec.chunk_id.id, 7797 stcb->asoc.peer_auth_chunks)) { 7798 omtu = sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id); 7799 } else 7800 omtu = 0; 7801 /* Here we do NOT factor the r_mtu */ | 6584 sctp_free_a_chunk(stcb, chk); 6585 } else if (chk->rec.chunk_id.id == SCTP_STREAM_RESET) { 6586 /* special handling, we must look into the param */ 6587 if (chk != asoc->str_reset) { 6588 goto clean_up_anyway; 6589 } 6590 } 6591 } --- 1204 unchanged lines hidden (view full) --- 7796 */ 7797 if ((auth == NULL) && 7798 sctp_auth_is_required_chunk(chk->rec.chunk_id.id, 7799 stcb->asoc.peer_auth_chunks)) { 7800 omtu = sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id); 7801 } else 7802 omtu = 0; 7803 /* Here we do NOT factor the r_mtu */ |
7802 if ((chk->send_size < (int)(mtu - omtu)) || | 7804 if ((chk->send_size <= (int)(mtu - omtu)) || |
7803 (chk->flags & CHUNK_FLAGS_FRAGMENT_OK)) { 7804 /* 7805 * We probably should glom the mbuf chain 7806 * from the chk->data for control but the 7807 * problem is it becomes yet one more level 7808 * of tracking to do if for some reason 7809 * output fails. Then I have got to 7810 * reconstruct the merged control chain.. el --- 1888 unchanged lines hidden (view full) --- 9699 goto sctp_fill_in_rest; 9700 } 9701 } 9702 /* Ok if we reach here we must build one */ 9703 sctp_alloc_a_chunk(stcb, chk); 9704 if (chk == NULL) { 9705 return; 9706 } | 7805 (chk->flags & CHUNK_FLAGS_FRAGMENT_OK)) { 7806 /* 7807 * We probably should glom the mbuf chain 7808 * from the chk->data for control but the 7809 * problem is it becomes yet one more level 7810 * of tracking to do if for some reason 7811 * output fails. Then I have got to 7812 * reconstruct the merged control chain.. el --- 1888 unchanged lines hidden (view full) --- 9701 goto sctp_fill_in_rest; 9702 } 9703 } 9704 /* Ok if we reach here we must build one */ 9705 sctp_alloc_a_chunk(stcb, chk); 9706 if (chk == NULL) { 9707 return; 9708 } |
9709 asoc->fwd_tsn_cnt++; |
|
9707 chk->copy_by_ref = 0; 9708 chk->rec.chunk_id.id = SCTP_FORWARD_CUM_TSN; 9709 chk->rec.chunk_id.can_take_data = 0; 9710 chk->asoc = asoc; 9711 chk->whoTo = NULL; 9712 chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); 9713 if (chk->data == NULL) { 9714 sctp_free_a_chunk(stcb, chk); --- 15 unchanged lines hidden (view full) --- 9730 { 9731 struct sctp_tmit_chunk *at, *tp1, *last; 9732 struct sctp_strseq *strseq; 9733 unsigned int cnt_of_space, i, ovh; 9734 unsigned int space_needed; 9735 unsigned int cnt_of_skipped = 0; 9736 9737 TAILQ_FOREACH(at, &asoc->sent_queue, sctp_next) { | 9710 chk->copy_by_ref = 0; 9711 chk->rec.chunk_id.id = SCTP_FORWARD_CUM_TSN; 9712 chk->rec.chunk_id.can_take_data = 0; 9713 chk->asoc = asoc; 9714 chk->whoTo = NULL; 9715 chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); 9716 if (chk->data == NULL) { 9717 sctp_free_a_chunk(stcb, chk); --- 15 unchanged lines hidden (view full) --- 9733 { 9734 struct sctp_tmit_chunk *at, *tp1, *last; 9735 struct sctp_strseq *strseq; 9736 unsigned int cnt_of_space, i, ovh; 9737 unsigned int space_needed; 9738 unsigned int cnt_of_skipped = 0; 9739 9740 TAILQ_FOREACH(at, &asoc->sent_queue, sctp_next) { |
9738 if ((at->sent != SCTP_FORWARD_TSN_SKIP) && 9739 (at->sent != SCTP_DATAGRAM_ACKED)) { | 9741 if ((at->sent != SCTP_FORWARD_TSN_SKIP) /* && (at->sent != 9742 SCTP_DATAGRAM_ACKED) */ ) { |
9740 /* no more to look at */ 9741 break; 9742 } 9743 if (at->rec.data.rcv_flags & SCTP_DATA_UNORDERED) { 9744 /* We don't report these */ 9745 continue; 9746 } 9747 cnt_of_skipped++; --- 3850 unchanged lines hidden --- | 9743 /* no more to look at */ 9744 break; 9745 } 9746 if (at->rec.data.rcv_flags & SCTP_DATA_UNORDERED) { 9747 /* We don't report these */ 9748 continue; 9749 } 9750 cnt_of_skipped++; --- 3850 unchanged lines hidden --- |