sctp_output.c (172091) | sctp_output.c (172156) |
---|---|
1/*- 2 * Copyright (c) 2001-2007, 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-2007, 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 172091 2007-09-08 17:48:46Z rrs $"); | 34__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 172156 2007-09-13 10:36:43Z 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> --- 5422 unchanged lines hidden (view full) --- 5465 if (srcv->sinfo_stream >= stcb->asoc.streamoutcnt) { 5466 /* Invalid stream number */ 5467 SCTP_LTRACE_ERR_RET_PKT(m, NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); 5468 error = EINVAL; 5469 goto out_now; 5470 } 5471 if ((stcb->asoc.stream_locked) && 5472 (stcb->asoc.stream_locked_on != srcv->sinfo_stream)) { | 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> --- 5422 unchanged lines hidden (view full) --- 5465 if (srcv->sinfo_stream >= stcb->asoc.streamoutcnt) { 5466 /* Invalid stream number */ 5467 SCTP_LTRACE_ERR_RET_PKT(m, NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); 5468 error = EINVAL; 5469 goto out_now; 5470 } 5471 if ((stcb->asoc.stream_locked) && 5472 (stcb->asoc.stream_locked_on != srcv->sinfo_stream)) { |
5473 SCTP_LTRACE_ERR_RET_PKT(m, NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, EAGAIN); 5474 error = EAGAIN; | 5473 SCTP_LTRACE_ERR_RET_PKT(m, NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); 5474 error = EINVAL; |
5475 goto out_now; 5476 } 5477 strm = &stcb->asoc.strmout[srcv->sinfo_stream]; 5478 /* Now can we send this? */ 5479 if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_SENT) || 5480 (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) || 5481 (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) || 5482 (stcb->asoc.state & SCTP_STATE_SHUTDOWN_PENDING)) { --- 4476 unchanged lines hidden (view full) --- 9959 int was_trunc = 0; 9960 struct ip *iph; 9961 int fullsz = 0, extra = 0; 9962 long spc; 9963 int offset; 9964 struct sctp_chunkhdr *ch, chunk_buf; 9965 unsigned int chk_length; 9966 | 5475 goto out_now; 5476 } 5477 strm = &stcb->asoc.strmout[srcv->sinfo_stream]; 5478 /* Now can we send this? */ 5479 if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_SENT) || 5480 (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) || 5481 (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) || 5482 (stcb->asoc.state & SCTP_STATE_SHUTDOWN_PENDING)) { --- 4476 unchanged lines hidden (view full) --- 9959 int was_trunc = 0; 9960 struct ip *iph; 9961 int fullsz = 0, extra = 0; 9962 long spc; 9963 int offset; 9964 struct sctp_chunkhdr *ch, chunk_buf; 9965 unsigned int chk_length; 9966 |
9967 /* sa_ignore NO_NULL_CHK */ | 9967 if (!stcb) { 9968 return; 9969 } |
9968 asoc = &stcb->asoc; 9969 SCTP_TCB_LOCK_ASSERT(stcb); 9970 if (asoc->peer_supports_pktdrop == 0) { 9971 /*- 9972 * peer must declare support before I send one. 9973 */ 9974 return; 9975 } --- 1663 unchanged lines hidden (view full) --- 11639 uint32_t sndout, initial_out; 11640 11641 initial_out = uio->uio_resid; 11642 11643 SCTP_TCB_SEND_LOCK(stcb); 11644 if ((asoc->stream_locked) && 11645 (asoc->stream_locked_on != srcv->sinfo_stream)) { 11646 SCTP_TCB_SEND_UNLOCK(stcb); | 9970 asoc = &stcb->asoc; 9971 SCTP_TCB_LOCK_ASSERT(stcb); 9972 if (asoc->peer_supports_pktdrop == 0) { 9973 /*- 9974 * peer must declare support before I send one. 9975 */ 9976 return; 9977 } --- 1663 unchanged lines hidden (view full) --- 11641 uint32_t sndout, initial_out; 11642 11643 initial_out = uio->uio_resid; 11644 11645 SCTP_TCB_SEND_LOCK(stcb); 11646 if ((asoc->stream_locked) && 11647 (asoc->stream_locked_on != srcv->sinfo_stream)) { 11648 SCTP_TCB_SEND_UNLOCK(stcb); |
11647 SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EAGAIN); 11648 error = EAGAIN; | 11649 SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); 11650 error = EINVAL; |
11649 goto out; 11650 } 11651 SCTP_TCB_SEND_UNLOCK(stcb); 11652 11653 strm = &stcb->asoc.strmout[srcv->sinfo_stream]; 11654 if (strm->last_msg_incomplete == 0) { 11655 do_a_copy_in: 11656 sp = sctp_copy_it_in(stcb, asoc, srcv, uio, net, max_len, user_marks_eor, &error, non_blocking); --- 707 unchanged lines hidden --- | 11651 goto out; 11652 } 11653 SCTP_TCB_SEND_UNLOCK(stcb); 11654 11655 strm = &stcb->asoc.strmout[srcv->sinfo_stream]; 11656 if (strm->last_msg_incomplete == 0) { 11657 do_a_copy_in: 11658 sp = sctp_copy_it_in(stcb, asoc, srcv, uio, net, max_len, user_marks_eor, &error, non_blocking); --- 707 unchanged lines hidden --- |