X-Git-Url: https://www.bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=tools%2Fserver.c;h=cb047113a6811e9b522f0d22c208b7c2fe3d948b;hp=363028f0c0ae7f76b926b328c288513e7fb10c35;hb=4aac1cd5c65462d5ad13e377705a00eab8c80d81;hpb=5f045c759957fdff8c85716e6af99e10901fdac0;ds=sidebyside diff --git a/tools/server.c b/tools/server.c index 363028f..cb04711 100644 --- a/tools/server.c +++ b/tools/server.c @@ -119,9 +119,16 @@ host_bind(const char *host, const char *port, int verbose) opt = 1; setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, sizeof opt); +#ifdef IPV6_V6ONLY + /* + * We want to make sure that the server socket works for + * both IPv4 and IPv6. But IPV6_V6ONLY is not defined on + * some very old systems. + */ opt = 0; setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&opt, sizeof opt); +#endif if (bind(fd, sa, sa_len) < 0) { if (verbose) { perror("bind()");