From: Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
To: ori@eigenstate.org
Cc: 9front@9front.org
Subject: Re: [9front] ape/bsd: Enable setting the local address with bind
Date: Wed, 20 Apr 2022 17:35:01 +0200 [thread overview]
Message-ID: <87bkwvydi2.fsf@turtle-trading.net> (raw)
In-Reply-To: <4E8DA25EACF13E3FFE406FE6B5FB9375@eigenstate.org>
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
next prev parent reply other threads:[~2022-04-20 15:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-04 20:00 Benjamin Riefenstahl
2022-01-21 14:22 ` [9front] " Benjamin Riefenstahl
2022-01-21 19:22 ` ori
2022-02-10 17:38 ` Benjamin Riefenstahl
2022-04-16 17:33 ` [9front] " ori
2022-04-20 15:35 ` Benjamin Riefenstahl [this message]
2022-06-10 15:14 ` Benjamin Riefenstahl
2022-06-10 15:16 ` Benjamin Riefenstahl
2022-06-11 17:13 ` ori
2022-06-11 18:31 ` Benjamin Riefenstahl
2022-07-07 21:22 ` Benjamin Riefenstahl
2022-07-17 19:05 ` ori
2022-07-17 22:01 ` Benjamin Riefenstahl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bkwvydi2.fsf@turtle-trading.net \
--to=b.riefenstahl@turtle-trading.net \
--cc=9front@9front.org \
--cc=ori@eigenstate.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).