tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: getaddrinfo: how to wildcard everything?



    Date:        Fri, 19 Mar 2021 16:07:57 -0400 (EDT)
    From:        Mouse <mouse%Rodents-Montreal.ORG@localhost>
    Message-ID:  <202103192007.QAA17672%Stone.Rodents-Montreal.ORG@localhost>

  | Not enumerating address families per se, but binding to a
  | kernel-selected port in each supported address family.

But binding TCP right?   (I think I recall that from your previous message).

  | > I'm not sure it is worth it either ... there are just 2 (IPv4 and
  | > IPv6)
  |
  | ...at the moment...

If there's a replacement, who can tell what it might be like?

  | > You could also just try "0" as the service name, though I'm not sure
  | > how portable that would be, if it works.

  | It would, at a minimum, be specific to service implementations being
  | small integers,

Yes, but you're using TCP (SOCK_STREAM) right?   Most other protocol
stacks have no real equivalent.   The protocol that's used comes with
all kinds of semantics that you cannot just ignore and pretend that
anything will do.  TP4 wouldn't work, it needs an accompanying session
protocol to handle graceful close (if even that really does it) for
example, and that's about the closest other transport protocol to TCP.
Session protocols don't typically live in the kernel...

There's just so much you can do to be independant of the environment.

  | (For that matter, I don't see anything in 793 that singles out port 0
  | for anything special,

No, there isn't, but it has been a reserved port number since the
beginning of time (probably from before TCP/UDP were invented, it was
the way Postel worked, and will continue to be that until port numbers
no longer exist (or longer), so using it to indicate something different
is not any big issue.

kre



Home | Main Index | Thread Index | Old Index