From owner-svn-src-all@FreeBSD.ORG Sun Nov 27 21:44:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B207106566C; Sun, 27 Nov 2011 21:44:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id 039CF8FC0A; Sun, 27 Nov 2011 21:44:48 +0000 (UTC) Received: from [192.168.1.200] (p508FA47F.dip.t-dialin.net [80.143.164.127]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 645071C0B4610; Sun, 27 Nov 2011 22:44:46 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Michael Tuexen In-Reply-To: <20111127202451.GA5466@freebsd.org> Date: Sun, 27 Nov 2011 22:44:45 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201111271751.pARHpDdr049714@svn.freebsd.org> <20111127202451.GA5466@freebsd.org> To: Alexander Best X-Mailer: Apple Mail (2.1251.1) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r228031 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2011 21:44:49 -0000 On Nov 27, 2011, at 9:24 PM, Alexander Best wrote: > On Sun Nov 27 11, Michael Tuexen wrote: >> Author: tuexen >> Date: Sun Nov 27 17:51:13 2011 >> New Revision: 228031 >> URL: http://svn.freebsd.org/changeset/base/228031 >>=20 >> Log: >> Fix a warning reported by arundel@. >> Fix a bug where the parameter length of a supported address types >> parameter is set to a wrong value if the kernel is built with >> with either INET or INET6, but not both. >>=20 >> MFC after: 3 days. >>=20 >> Modified: >> head/sys/netinet/sctp_header.h >> head/sys/netinet/sctp_output.c >>=20 >> Modified: head/sys/netinet/sctp_header.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_header.h Sun Nov 27 17:05:26 2011 = (r228030) >> +++ head/sys/netinet/sctp_header.h Sun Nov 27 17:51:13 2011 = (r228031) >> @@ -81,8 +81,7 @@ struct sctp_host_name_param { >> /* supported address type */ >> struct sctp_supported_addr_param { >> struct sctp_paramhdr ph;/* type=3DSCTP_SUPPORTED_ADDRTYPE */ >> - uint16_t addr_type[SCTP_ARRAY_MIN_LEN]; /* array of supported = address >=20 > since SCTP_ARRAY_MIN_LEN is only used in one other place, i think we = can remove > it entirely (see the attached patch). >=20 > cheers. > alex >=20 >> - * types */ >> + uint16_t addr_type[2]; /* array of supported address types */ >> } SCTP_PACKED; >>=20 >> /* ECN parameter */ >>=20 >> Modified: head/sys/netinet/sctp_output.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_output.c Sun Nov 27 17:05:26 2011 = (r228030) >> +++ head/sys/netinet/sctp_output.c Sun Nov 27 17:51:13 2011 = (r228031) >> @@ -4680,24 +4680,24 @@ sctp_send_initiate(struct sctp_inpcb *in >> #ifdef INET6 >> #ifdef INET >> /* we support 2 types: IPv4/IPv6 */ >> - sup_addr->ph.param_length =3D htons(sizeof(*sup_addr) + = sizeof(uint16_t)); >> + sup_addr->ph.param_length =3D htons(sizeof(struct sctp_paramhdr) = + 2 * sizeof(uint16_t)); >> sup_addr->addr_type[0] =3D htons(SCTP_IPV4_ADDRESS); >> sup_addr->addr_type[1] =3D htons(SCTP_IPV6_ADDRESS); >> #else >> /* we support 1 type: IPv6 */ >> - sup_addr->ph.param_length =3D htons(sizeof(*sup_addr) + = sizeof(uint8_t)); >> + sup_addr->ph.param_length =3D htons(sizeof(struct sctp_paramhdr) = + sizeof(uint16_t)); >> sup_addr->addr_type[0] =3D htons(SCTP_IPV6_ADDRESS); >> sup_addr->addr_type[1] =3D htons(0); /* this is the padding = */ >> #endif >> #else >> /* we support 1 type: IPv4 */ >> - sup_addr->ph.param_length =3D htons(sizeof(*sup_addr) + = sizeof(uint8_t)); >> + sup_addr->ph.param_length =3D htons(sizeof(struct sctp_paramhdr) = + sizeof(uint16_t)); >> sup_addr->addr_type[0] =3D htons(SCTP_IPV4_ADDRESS); >> sup_addr->addr_type[1] =3D htons(0); /* this is the padding = */ >> #endif >> - SCTP_BUF_LEN(m) +=3D sizeof(*sup_addr) + sizeof(uint16_t); >> + SCTP_BUF_LEN(m) +=3D sizeof(struct sctp_supported_addr_param); >> /* adaptation layer indication parameter */ >> - ali =3D (struct sctp_adaptation_layer_indication = *)((caddr_t)sup_addr + sizeof(*sup_addr) + sizeof(uint16_t)); >> + ali =3D (struct sctp_adaptation_layer_indication = *)((caddr_t)sup_addr + sizeof(struct sctp_supported_addr_param)); >> ali->ph.param_type =3D htons(SCTP_ULP_ADAPTATION); >> ali->ph.param_length =3D htons(sizeof(*ali)); >> ali->indication =3D = ntohl(inp->sctp_ep.adaptation_layer_indicator); > yes, that is possible... Best regards Michael