From owner-svn-src-head@FreeBSD.ORG Mon Mar 11 17:47:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1DE43396; Mon, 11 Mar 2013 17:47:56 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) 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 93D36310; Mon, 11 Mar 2013 17:47:55 +0000 (UTC) Received: from dhcp-9228.meeting.ietf.org (dhcp-9228.meeting.ietf.org [130.129.10.40]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 482241C0C0BF5; Mon, 11 Mar 2013 18:47:52 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1283) Subject: Re: svn commit: r248172 - head/sys/kern From: Michael Tuexen In-Reply-To: <201303111743.r2BHhuCj029280@svn.freebsd.org> Date: Mon, 11 Mar 2013 13:47:50 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201303111743.r2BHhuCj029280@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.1283) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Mar 2013 17:47:56 -0000 On Mar 11, 2013, at 1:43 PM, Michael Tuexen wrote: > Author: tuexen > Date: Mon Mar 11 17:43:55 2013 > New Revision: 248172 > URL: http://svnweb.freebsd.org/changeset/base/248172 >=20 > Log: > Return an error if sctp_peeloff() fails because a socket can't be = allocated. Hmm. Just wanted to commit the change to uipc_syscalls.c and do the other fix separately. So the missing commit message is: sctp_peeloff() uses sonewconn() also in cases where listen() wasn't = called. So honor this use case. >=20 > MFC after: 3 days >=20 > Modified: > head/sys/kern/uipc_socket.c > head/sys/kern/uipc_syscalls.c >=20 > Modified: head/sys/kern/uipc_socket.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/kern/uipc_socket.c Mon Mar 11 17:36:37 2013 = (r248171) > +++ head/sys/kern/uipc_socket.c Mon Mar 11 17:43:55 2013 = (r248172) > @@ -136,6 +136,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include >=20 > #include >=20 > @@ -565,8 +566,12 @@ sonewconn(struct socket *head, int conns > /* > * The accept socket may be tearing down but we just > * won a race on the ACCEPT_LOCK. > + * However, if sctp_peeloff() is called on a 1-to-many > + * style socket, the SO_ACCEPTCONN doesn't need to be set. > */ > - if (!(head->so_options & SO_ACCEPTCONN)) { > + if (!(head->so_options & SO_ACCEPTCONN) && > + ((head->so_proto->pr_protocol !=3D IPPROTO_SCTP) || > + (head->so_type !=3D SOCK_SEQPACKET))) { > SOCK_LOCK(so); > so->so_head =3D NULL; > sofree(so); /* NB: returns ACCEPT_UNLOCK'ed. = */ >=20 > Modified: head/sys/kern/uipc_syscalls.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/kern/uipc_syscalls.c Mon Mar 11 17:36:37 2013 = (r248171) > +++ head/sys/kern/uipc_syscalls.c Mon Mar 11 17:43:55 2013 = (r248172) > @@ -2386,8 +2386,10 @@ sys_sctp_peeloff(td, uap) >=20 > CURVNET_SET(head->so_vnet); > so =3D sonewconn(head, SS_ISCONNECTED); > - if (so =3D=3D NULL) > + if (so =3D=3D NULL) { > + error =3D ENOMEM; > goto noconnection; > + } > /* > * Before changing the flags on the socket, we have to bump the > * reference count. Otherwise, if the protocol calls sofree(), >=20