From owner-svn-src-stable@FreeBSD.ORG Thu Mar 7 21:38:45 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6C6D61FB; Thu, 7 Mar 2013 21:38:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 574E5616; Thu, 7 Mar 2013 21:38:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27Lcjp9018852; Thu, 7 Mar 2013 21:38:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LcipM018845; Thu, 7 Mar 2013 21:38:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072138.r27LcipM018845@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 21:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247954 - in stable/8/sys: netinet netinet6 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:38:45 -0000 Author: tuexen Date: Thu Mar 7 21:38:43 2013 New Revision: 247954 URL: http://svnweb.freebsd.org/changeset/base/247954 Log: MFC r237542: Pass the packet length explicitly around. Modified: stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Thu Mar 7 21:37:23 2013 (r247953) +++ stable/8/sys/netinet/sctp_indata.c Thu Mar 7 21:38:43 2013 (r247954) @@ -2762,7 +2762,7 @@ sctp_process_data(struct mbuf **mm, int /* * we need to report rwnd overrun drops. */ - sctp_send_packet_dropped(stcb, net, *mm, iphlen, 0); + sctp_send_packet_dropped(stcb, net, *mm, length, iphlen, 0); } if (num_chunks) { /* Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:37:23 2013 (r247953) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:38:43 2013 (r247954) @@ -6013,7 +6013,7 @@ sctp_input_with_port(struct mbuf *i_pak, #endif } if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, iphlen, 1); + sctp_send_packet_dropped(stcb, net, m, mlen + iphlen, iphlen, 1); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); } else if ((inp != NULL) && (stcb == NULL)) { refcount_up = 1; Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 21:37:23 2013 (r247953) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 21:38:43 2013 (r247954) @@ -11312,21 +11312,15 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb void sctp_send_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net, - struct mbuf *m, int iphlen, int bad_crc) + struct mbuf *m, int len, int iphlen, int bad_crc) { struct sctp_association *asoc; struct sctp_pktdrop_chunk *drp; struct sctp_tmit_chunk *chk; uint8_t *datap; - int len; int was_trunc = 0; struct ip *iph; - -#ifdef INET6 - struct ip6_hdr *ip6h; - -#endif - int fullsz = 0, extra = 0; + int fullsz = 0; long spc; int offset; struct sctp_chunkhdr *ch, chunk_buf; @@ -11356,23 +11350,8 @@ sctp_send_packet_dropped(struct sctp_tcb sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - /* IPv4 */ - len = chk->send_size = iph->ip_len; - break; -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - /* IPv6 */ - ip6h = mtod(m, struct ip6_hdr *); - len = chk->send_size = htons(ip6h->ip6_plen); - break; -#endif - default: - return; - } + len -= iphlen; + chk->send_size = len; /* Validate that we do not have an ABORT in here. */ offset = iphlen + sizeof(struct sctphdr); ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset, @@ -11408,7 +11387,7 @@ sctp_send_packet_dropped(struct sctp_tcb /* * only send 1 mtu worth, trim off the excess on the end. */ - fullsz = len - extra; + fullsz = len; len = min(stcb->asoc.smallest_mtu, MCLBYTES) - SCTP_MAX_OVERHEAD; was_trunc = 1; } Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Thu Mar 7 21:37:23 2013 (r247953) +++ stable/8/sys/netinet/sctp_output.h Thu Mar 7 21:38:43 2013 (r247954) @@ -162,7 +162,7 @@ void sctp_send_ecn_echo(struct sctp_tcb void sctp_send_packet_dropped(struct sctp_tcb *, struct sctp_nets *, struct mbuf *, - int, int); + int, int, int); Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 21:37:23 2013 (r247953) +++ stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 21:38:43 2013 (r247954) @@ -183,7 +183,7 @@ sctp6_input(struct mbuf **i_pak, int *of } /* in6p's ref-count increased && stcb locked */ if ((in6p) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, iphlen, 1); + sctp_send_packet_dropped(stcb, net, m, pkt_len, iphlen, 1); sctp_chunk_output((struct sctp_inpcb *)in6p, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); } else if ((in6p != NULL) && (stcb == NULL)) { refcount_up = 1;