sctp_output.c (164181) | sctp_output.c (164205) |
---|---|
1/*- 2 * Copyright (c) 2001-2006, 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-2006, 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 164181 2006-11-11 15:59:01Z rrs $"); | 34__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 164205 2006-11-11 22:44:12Z rrs $"); |
35 36#include "opt_ipsec.h" 37#include "opt_compat.h" 38#include "opt_inet6.h" 39#include "opt_inet.h" 40#include "opt_sctp.h" 41#include <sys/param.h> 42#include <sys/systm.h> --- 7116 unchanged lines hidden (view full) --- 7159 } else { 7160 nagle_on = 1; 7161 } 7162 } 7163 SCTP_TCB_LOCK_ASSERT(stcb); 7164 7165 un_sent = (stcb->asoc.total_output_queue_size - stcb->asoc.total_flight); 7166 | 35 36#include "opt_ipsec.h" 37#include "opt_compat.h" 38#include "opt_inet6.h" 39#include "opt_inet.h" 40#include "opt_sctp.h" 41#include <sys/param.h> 42#include <sys/systm.h> --- 7116 unchanged lines hidden (view full) --- 7159 } else { 7160 nagle_on = 1; 7161 } 7162 } 7163 SCTP_TCB_LOCK_ASSERT(stcb); 7164 7165 un_sent = (stcb->asoc.total_output_queue_size - stcb->asoc.total_flight); 7166 |
7167 | |
7168 if ((un_sent <= 0) && 7169 (TAILQ_EMPTY(&asoc->control_send_queue)) && 7170 (asoc->sent_queue_retran_cnt == 0)) { 7171 /* Nothing to do unless there is something to be sent left */ 7172 return (error); 7173 } 7174 /* 7175 * Do we have something to send, data or control AND a sack timer 7176 * running, if so piggy-back the sack. 7177 */ 7178 if (callout_pending(&stcb->asoc.dack_timer.timer)) { 7179 sctp_send_sack(stcb); 7180 callout_stop(&stcb->asoc.dack_timer.timer); 7181 } 7182 while (asoc->sent_queue_retran_cnt) { 7183 /* 7184 * Ok, it is retransmission time only, we send out only ONE 7185 * packet with a single call off to the retran code. 7186 */ | 7167 if ((un_sent <= 0) && 7168 (TAILQ_EMPTY(&asoc->control_send_queue)) && 7169 (asoc->sent_queue_retran_cnt == 0)) { 7170 /* Nothing to do unless there is something to be sent left */ 7171 return (error); 7172 } 7173 /* 7174 * Do we have something to send, data or control AND a sack timer 7175 * running, if so piggy-back the sack. 7176 */ 7177 if (callout_pending(&stcb->asoc.dack_timer.timer)) { 7178 sctp_send_sack(stcb); 7179 callout_stop(&stcb->asoc.dack_timer.timer); 7180 } 7181 while (asoc->sent_queue_retran_cnt) { 7182 /* 7183 * Ok, it is retransmission time only, we send out only ONE 7184 * packet with a single call off to the retran code. 7185 */ |
7187 if (from_where != SCTP_OUTPUT_FROM_HB_TMR) { | 7186 if (from_where == SCTP_OUTPUT_FROM_COOKIE_ACK) { 7187 /* 7188 * Special hook for handling cookiess discarded by 7189 * peer that carried data. Send cookie-ack only and 7190 * then the next call with get the retran's. 7191 */ 7192 (void)sctp_med_chunk_output(inp, stcb, asoc, &num_out, &reason_code, 1, 7193 &cwnd_full, from_where, 7194 &now, &now_filled, frag_point); 7195 return (0); 7196 } else if (from_where != SCTP_OUTPUT_FROM_HB_TMR) { |
7188 /* if its not from a HB then do it */ 7189 ret = sctp_chunk_retransmission(inp, stcb, asoc, &num_out, &now, &now_filled); 7190 } else { 7191 /* 7192 * its from any other place, we don't allow retran 7193 * output (only control) 7194 */ 7195 ret = 1; --- 3196 unchanged lines hidden --- | 7197 /* if its not from a HB then do it */ 7198 ret = sctp_chunk_retransmission(inp, stcb, asoc, &num_out, &now, &now_filled); 7199 } else { 7200 /* 7201 * its from any other place, we don't allow retran 7202 * output (only control) 7203 */ 7204 ret = 1; --- 3196 unchanged lines hidden --- |