From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24487 invoked from network); 16 Apr 2022 17:35:10 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 16 Apr 2022 17:35:10 -0000 Received: from mimir.eigenstate.org ([206.124.132.107]) by 9front; Sat Apr 16 13:34:07 -0400 2022 Received: from abbatoir.myfiosgateway.com (pool-74-108-56-225.nycmny.fios.verizon.net [74.108.56.225]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id 208ab0f7 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9front@9front.org>; Sat, 16 Apr 2022 10:33:55 -0700 (PDT) Message-ID: <4E8DA25EACF13E3FFE406FE6B5FB9375@eigenstate.org> To: 9front@9front.org Date: Sat, 16 Apr 2022 13:33:54 -0400 From: ori@eigenstate.org In-Reply-To: <87pmp72rv5.fsf@turtle-trading.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: SOAP over XML package factory-aware information rails layer Subject: Re: [9front] ape/bsd: Enable setting the local address with bind Reply-To: 9front@9front.org Precedence: bulk Apologies for taking so long to respond. Life got busy, and I forgot. Quoth Benjamin Riefenstahl : > The current code ignores the address as passed to the BSD socket > function bind(). It seems that that may not have been possible with > earlier versions of the net API? I discovered by reading the code and > experimentation that this seems to work fine in the current net API, so > this implements it for BSD sockets. > > I removed some previous code that did not make sense to me, so you may > want to check that I did not screw up. What I mean is "bind *" in > bind() and about "bind 0" in listen(). > > The handling when ports < 0 are specified is not consistent yet. Either > we should normalize the ports to be at least 0, or we should return an > error condition for ports < 0. This looks like it's attempting (incorrectly?) to implement INADDR_ANY, binding to any ip address. However, INADDR_ANY is 0: /sys/include/ape/netinet/in.h:98: #define INADDR_ANY (unsigned long)0x00000000 And I see no specification that describes what should be done with negative ports in the sockets world, so I can only assume that this is a bug. I don't think 'bind *' should be removed, since it seems to me that it works as intended for binding to all addresses, but the ape userspace for it is wrong. > The documentation in the man page ip(3) for the control commands "bind" > and "announce" does not mention the local address, should that be fixed, > too? Yes, that would be wonderful.