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=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22986 invoked from network); 20 Apr 2022 15:36:57 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 20 Apr 2022 15:36:57 -0000 Received: from odoacer.turtle-trading.net ([93.241.193.16]) by 9front; Wed Apr 20 11:35:12 -0400 2022 Received: from zenobia.turtle-trading.net ([192.168.2.111]) by odoacer.turtle-trading.net with esmtp (Exim 4.80) (envelope-from ) id 1nhCM9-0004px-Nt; Wed, 20 Apr 2022 17:35:01 +0200 Received: from benny by zenobia.turtle-trading.net with local (Exim 4.94.2) (envelope-from ) id 1nhCM9-000Nuh-Ff; Wed, 20 Apr 2022 17:35:01 +0200 From: Benjamin Riefenstahl To: ori@eigenstate.org Cc: 9front@9front.org References: <4E8DA25EACF13E3FFE406FE6B5FB9375@eigenstate.org> Date: Wed, 20 Apr 2022 17:35:01 +0200 Message-ID: <87bkwvydi2.fsf@turtle-trading.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: virtual hardware database-based XMPP over XMPP proxy core realtime framework Subject: Re: [9front] ape/bsd: Enable setting the local address with bind Reply-To: 9front@9front.org Precedence: bulk Hi Ori, Ori writes: > Apologies for taking so long to respond. Life got busy, and I forgot. No problem. I often take my time myself ;-) Thanks for looking at it now. Note that this is some time ago for me now, too, so I may remember wrongly how and why I did things and I will have to redo the tests. > 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 As far as I can tell, using IP address INADDR_ANY and using port 0 to indicate that the IP stack should choose the actual number both work with the native control commands, so they do not need much special care here. > 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/we should probably just make negative ports an error. > 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. When I tried this a long time ago, when this was called it just returned errors. INADDR_ANY just works, I think, so there does not seem to be a reason for this special handling. I will have to create some test cases to see what works and what doesn't. >> 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. Another one for the todo list then ;-) Thanks, benny