chiark / gitweb /
udp: Support IPv6 (mostly)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 2 Sep 2014 08:05:30 +0000 (09:05 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 2 Oct 2014 15:30:21 +0000 (16:30 +0100)
Specifically:

 * struct udp now contains an array of (up to three) pairs of iaddr,
   fd.  Code which deals with the fd and addr has been updated to use
   loops etc. as appropriate.

 * The sockets are created with the right protocol family value.
   For AF_INET6, we set IPV6_V6ONLY.

 * Specifically, when transmitting, we try all appropriate sockets and
   compute the persistent-failure indication as required.

 * And a comm_addr now contains an `int ix' for udp.c's benefit; this
   allows udp to note in the comm_addr which socket an incoming packet
   was received on (which is required for logging etc.).  (NB that the
   socket index is ignored when sending; this is so that we can
   continue to construct a comm_addr in the current way; it will
   simply show up as notionally attached to the first of the udp's
   interfaces.)

 * We use text2iaddr to convert the string to a socket address, rather
   than string_item_to_ipaddr.  The latter can cope only with IPv4
   (and is now used only for private vpn addrs, proxies, etc.).

 * The default is now to create both IPv6 and IPv4 sockets.

Left undone are:

 * The special secnet proxy protocol has a 4-byte address prepended
   which implies IPv4.  I don't intend to fix this.

 * The authbind support for IPv6 will be in a future patch.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>

No differences found