MINOR: server: add support for explicit numeric address in init-addr
This will allow a server to automatically fall back to an explicit numeric
IP address when all other methods fail. The address is simply specified in
the address list.
diff --git a/include/types/server.h b/include/types/server.h
index f5aebb1..c6c581c 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -96,6 +96,7 @@
SRV_IADDR_NONE = 1, /* the server won't have any address at start up */
SRV_IADDR_LIBC = 2, /* address set using the libc DNS resolver */
SRV_IADDR_LAST = 3, /* we set the IP address found in state-file for this server */
+ SRV_IADDR_IP = 4, /* we set an arbitrary IP address to the server */
};
/* server-state-file version */
@@ -245,6 +246,7 @@
char *lastaddr; /* the address string provided by the server-state file */
struct dns_resolution *resolution; /* server name resolution */
struct dns_options dns_opts;
+ struct sockaddr_storage init_addr; /* plain IP address specified on the init-addr line */
unsigned int init_addr_methods; /* initial address setting, 3-bit per method, ends at 0, enough to store 10 entries */
#ifdef USE_OPENSSL