From owner-freebsd-ports@freebsd.org Mon Feb 22 01:59:38 2016 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77E63AB0750 for ; Mon, 22 Feb 2016 01:59:38 +0000 (UTC) (envelope-from null@pozo.com) Received: from pozo.com (pozo.com [50.197.129.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "pozo.com", Issuer "pozo.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 430AB1E55; Mon, 22 Feb 2016 01:59:38 +0000 (UTC) (envelope-from null@pozo.com) Received: from octo.pozo.com (octo.pozo.com [192.168.0.2]) (authenticated bits=128) by pozo.com (8.15.2/8.15.2) with ESMTPA id u1M1xJ2W012768; Sun, 21 Feb 2016 17:59:19 -0800 (PST) (envelope-from null@pozo.com) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: xtide 2.15 on FreeBSD-current amd64 From: Manfred Antar In-Reply-To: <56CA6368.4030304@flaterco.com> Date: Sun, 21 Feb 2016 17:59:18 -0800 Cc: vanilla@FreeBSD.org, FreeBSD Ports ML Content-Transfer-Encoding: quoted-printable Message-Id: References: <86A01DE5-6592-4F9C-A224-F870F0C5517B@pozo.com> <56C9BD0E.7070301@flaterco.com> <89BBBB54-8BF1-4E61-A426-0B8D30DDE654@pozo.com> <56CA6368.4030304@flaterco.com> To: David Flater X-Mailer: Apple Mail (2.3112) X-Spam-Status: No, score=-102.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, URIBL_BLOCKED, USER_IN_WHITELIST autolearn=ham autolearn_force=no version=3.4.1, No X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on pozo.com X-pozocom-MailScanner-Information: Please contact the ISP for more information X-pozocom-MailScanner-ID: u1M1xJ2W012768 X-pozocom-MailScanner: Found to be clean X-pozocom-MailScanner-From: null@pozo.com X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 01:59:38 -0000 > On Feb 21, 2016, at 5:24 PM, David Flater wrote: >=20 > On 02/21/2016 11:58 AM, Manfred Antar wrote: >> Same error in syslog CANT_GET_SOCKET. >=20 > Please test this patch against the xttpd of xtide-2.15. >=20 > DWF >=20 > Index: xttpd.cc > =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 > --- xttpd.cc (revision 6265) > +++ xttpd.cc (working copy) > @@ -258,7 +258,21 @@ > Global::xperror ("setsockopt"); > } > } > - bool bound =3D (bind(s,(sockaddr *)&addr,sizeof(addr))=3D=3D0); > + > + // 2016-02-21 Manfred Antar reported "bind: Invalid argument" occurri= ng on > + // FreeBSD and OS X as a regression from 2.14 when trying to bind port > + // 8080, with or without an explicit address. The only change that sh= ould > + // have been visible to bind is that the size argument got bigger. The > + // FreeBSD man page for bind states that EINVAL can be raised if "the > + // addrlen argument is not a valid length for the address family." I = guess > + // this means that apps making use of sockaddr_storage are supposed to= lie > + // about the length. The linux man page similarly states that EINVAL = can > + // be raised if "the addrlen is wrong" but the problem does not reprod= uce > + // with my libc. > + const socklen_t addrlen (addr.ss_family=3D=3DAF_INET6 ? sizeof(sockadd= r_in6) > + : sizeof(sockaddr_in= )); > + > + bool bound =3D (bind(s,(sockaddr *)&addr,addrlen)=3D=3D0); > int yerrno =3D errno; > if (!bound && addr.ss_family =3D=3D AF_INET6) { >=20 > @@ -288,7 +302,7 @@ >=20 > for (unsigned magic=3D4; !bound && magic>0; --magic) { > ((sockaddr_in6 *)&addr)->sin6_scope_id =3D magic; > - bound =3D (bind(s,(sockaddr *)&addr,sizeof(addr))=3D=3D0); > + bound =3D (bind(s,(sockaddr *)&addr,addrlen)=3D=3D0); > } > } > // Report the error from the first failure so that it won't be obscured= by That works here on FreeBSD-current amd64 and also on OS X El Capitan. Thanks !!!!!!