chiark / gitweb /
pkstream/pkstream.c: Use `getaddrinfo' to resolve addresses and services.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 28 Sep 2017 00:41:43 +0000 (01:41 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 28 Jun 2018 23:23:56 +0000 (00:23 +0100)
commit0bf142d2dc68ff6dc43c329332ec09ac28166905
tree4dc860d6d85594c98e78acde3da88846f5b84561
parent5c8525cb2bbe784c14014e72ad7a63d6afecea1c
pkstream/pkstream.c: Use `getaddrinfo' to resolve addresses and services.

This will give us multiple addresses for simple queries, which we must
do something sensible with:

  * for server bind and peer addresses, we accumulate them in our
    address vectors as before;

  * for client bind addresses, and local UDP addresses, we just take
    the first match, and hope that's good enough; and

  * for client connect addresses, and remote UDP addresses, we try to
    connect to each address in turn and take the first one that works.

Some utility functions have been added or enhanced:

  * `pushaddr' has become `pushaddrs', and its job is now to push the
    addresses from a `struct addrinfo' chain onto an address vector; and

  * `copyaddr' has been introduced to do possible partial copies of
    addresses.

Note that everything is still strictly IPv4 throughout.  But almost all
of the pieces are now in place...
pkstream/pkstream.c